hello,
Can anyone tell me how to use regular expressions in qtp.and wht does tht mean if provided with example...it would be great help.:)
Printable View
hello,
Can anyone tell me how to use regular expressions in qtp.and wht does tht mean if provided with example...it would be great help.:)
Thank You So Much
[QUOTE=gouthami123;13588]hello,
Can anyone tell me how to use regular expressions in qtp.and wht does tht mean if provided with example...it would be great help.:)[/QUOTE]
:confused: sorry ya... we r also searching.. once v r getting inform u.....
Regular expression are used when the part of the particular property of an object which was used most oftenly changes dynamically ..
Say suppose for an example...take google application..
Iteration1:
Enter [COLOR="RoyalBlue"]QTP [/COLOR]in the search edit box
Click on the Search button
Ieration2:
Enter [COLOR="royalblue"]Winrunner [/COLOR]in the search edit box
Click on the search button
in the above scenario Search edit box(QTP and Winrunner) can be parameterized.When we hit the search button, the browser name will be "Google - QTP" for Iterantion1 and "Google - Winrunner" for iteration2.
So "Google" is the common word for the browser name property.Here we can use regular expression to make the script reusable.
v_SearchText = DataTable("SerachText","Action1")
Browser("name:=Google").Page("title:=Google").WebEdit("name:=q").Set v_SearchText
Browser("name:=Google").Page("title:=Google").WebButton("name:=Search").Click
[COLOR="Blue"]Browser("name:=Google.*").Page("title:=Google.*").[/COLOR]WebEdit("name:=q","index:=0").Set "Mercury"
Hope u got some idea now:)