Micro Focus QTP (UFT) Forums
Regular Expression Syntax - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Regular Expressions (https://www.learnqtp.com/forums/Forum-UFT-QTP-Regular-Expressions)
+--- Thread: Regular Expression Syntax (/Thread-Regular-Expression-Syntax)

Pages: 1 2 3 4


Regular Expression Syntax - Anu - 05-25-2010

I want to use regular expression for the link because on click of every link,it navigates to new web page.
The code is written below:
Code:
Browser(“Browser”).Page(“Page”).Link(“Next”).Click

Here ‘Next’ is present on every web page and instead of using Data Table, i want to use regular expression in the Object Repository.
Please tell me which syntax of the regular expression i used in this.

Thanks in advance…….

Regards,
Anu


RE: Regular Expression Syntax - Saket - 05-25-2010

look for the similar properties of link 'next' in the pages and use descriptive programming.
e.g
Code:
Browser().Page().Link("text:=Next","html tag:=A")

does this help?


RE: Regular Expression Syntax - Anu - 05-25-2010

Hi Saket,
I used the below code
Code:
Browser().Page().Link("text:=Next","html tag:=A")

That is :
Code:
Browser("Browser").Page("Page").Link("text:=Next","html tag:=A").Click
When i run this then it shows the error message which i have attached with it.

Regards,
Anu


RE: Regular Expression Syntax - Saket - 05-25-2010

I just gave an example, you will need to look for the properties which will uniquely identify your object.


RE: Regular Expression Syntax - Anu - 05-25-2010

Hi Sanket,
Thanks for reply........
Could you please tell me how to uniquely identify an object because i am new in this.

Regards,
Anu


RE: Regular Expression Syntax - Anu - 05-28-2010

Hi Saket,

Please assist me so that i can proceed further.

Thanks in advance....................

Regards,
Anu


RE: Regular Expression Syntax - funajju - 05-28-2010

HI anu ,

By Using Object Spy u can get the object properties & values of it.
U can use any values of it ,for example like same as above Browser().Page().Link("text:=Next","html tag:=A","hwnd:=xxx",xxx).
U can additional properties of it by using. then surely it wil identity.try it once by adding additional properties


RE: Regular Expression Syntax - Anu - 05-28-2010

Hi Saket,

As Next is present on every page but it has different url or href corresponding to that page.

Regards,
Anu


RE: Regular Expression Syntax - Saket - 05-28-2010

try regularising the url of page. It should be something like
Code:
http.*://.*/pages/Lookup\.aspx\?.*



RE: Regular Expression Syntax - Anu - 05-28-2010

Hi Saket,

this is the url "http://210.212.176.226/ins_byname.php?page=2" for Next and which increments as we click the Next.
Here page increments such as page=3,page=4.The rest of the url remains same.
Could you please tell what will be the regular expression for the same.

Regards,
Anu