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.
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
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 QTP in the search edit box
Click on the Search button
Ieration2:
Enter Winrunner 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
Browser("name:=Google.*").Page("title:=Google.*").WebEdit("name:=q","index:=0").Set "Mercury"
Hope u got some idea now