Micro Focus QTP (UFT) Forums

Full Version: LInk reg expression
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I have a qtp statement:

Code:
Browser("browser").Page("page").Link("Page (6)").Check CheckPoint("Page (6)")

how do i parameratize page (6).

i went to <<link removed>> OR, change to Page \(0-10\)

then i went to check point OR, change to Page \(0-10\)
but it still does not work.

Please advise.

Actually it works if i write as Page \([\d]\).

it does not work, number is more than 9.

that means if i have page(9) it works.
if i have page(200), it does not work.

Pls advise.
write it like

Page\([0-9]+\)

Regards,
Ankesh
I have below code..its not giving any error it just goes through and doesn't click register link. what am I doing wrong? Please help

Code:
if Browser("openurl:=.*").Page("url:=http://www.yahoo.com.*").link("href:= http://www.yahoo.com.*","name:=register").Exist then
   Browser("openurl:=.*").Page("url:=http://www.yahoo.com.*").link("href:= http://www.yahoo.com.*","name:=register").Click
end if
Also Tried
if Browser("openurl:=.*").Page("url:=.*").link("html tag:=A", "name:=register", "href:= http://www.yahoo.com.*").exist then
   Browser("openurl:=.*").Page("url:=.*").link("html tag:=A", "name:=register", "href:= http://www.yahoo.com.*").click
end if

No luck with both..
Probably it is not finding the object. First highlight the object and then click on it.
you may use the title property for browser and page objects.

Regards,
Ankesh