-
Junior Member
Regular expression
How to use the Regular expression? Please give an example. In which circumstances we can use it? Please help
-
Contributing Member
Re: Regular expression
Hi There,
Regular expressions are used when the values of the objects are varying(dynamic data).
For example when you login to yahoo mail with user name "XYZ", on the top you see "Welcome XYZ" if you login as "ABC" the screen display "Welcome ABC"
You can define a regular expression as:
Dim regEx, Match, Matches ' declare variable
RegExpTest = "" ' initial the result variable
Set regEx = New RegExp ' create a regular expression object
regEx.Pattern = "[a-zA-Z0-9 ]" ' set its pattern
regEx.IgnoreCase = True ' set case insensitivity
Here "Pattern" will be your regular expression and you can use it wherever the data is dynamic.
I hope it's clear, do get back incase you still have doubts.
Regards,
Tina Mahajan.
-
Junior Member
Re: Regular expression
Hi Tina,
U so lovely ! Thank you soo much for ur reply.
THis is clear with me. I have one more doubt - When we are going to parameterize we wil get a screen with a checkbox for Regular expression. My doubt is how to use and when to use that regular expression check box. You have given the coding. My doubt is here..
Please gimme the answer for this also
-
Contributing Member
Re: Regular expression
Hi there,
I didnt get your question.
When you parameterize, u get a "Value Configuration Options" screen. There is no checkbox here. There are RadioGroups.
Using parameteriztion you are providing different values that are to be entered in the form of data table. You dont have to use regular expressions here.
Regards,
Tina Mahajan
Last edited by Tina Mahajan; 06-05-2008 at 12:48 AM.
-
Junior Member
Re: Regular expression
Hi Tina,
I will clear my question with an example.
Record any link. Goto Object Repository->Click on the specified link ->On the right side of the repository u can see the 'Test Object Details' - below that 'name' and 'value'. Click on the text(for example)-In the value column you can see the text of the link and the right side <#> . Click on that - you will be in "Value Configurations Options" box. There u can see the check box "Regular expression". ( )
My question is how it will be useful in that condition?
Love
Euro
-
Contributing Member
Re: Regular expression
Ok got it now!
When you select constant and check on the regular expression,
You can simply substitute a value with regular expression like [a-z][A-Z][0-9]
in the textbox infront of constant radiobutton.
So this will refer to any link having alphanumeric value for name property.
But when you are parameterizing, I dont think you need regular expression sice you can provide all the desired values in the data table.
Regards,
Tina Mahajan.
-
Junior Member
Re: Regular expression
hi tina
i am nean u w in qtp. can u lemme know how to capture movie clip of result. in qtp 9.2.
thanks in advns
-
Junior Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules