Micro Focus QTP (UFT) Forums
XPath for web link throws error - 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 Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: XPath for web link throws error (/Thread-XPath-for-web-link-throws-error)



XPath for web link throws error - srselva - 12-08-2012

I am trying to use the following simple xpath, but iam getting maintenance run error

Code:
browser("micclass:=browser").Page("micclass:=page").link("xpath:=//a[@id='addlang']/a[1]").click



RE: XPath for web link throws error - supputuri - 12-11-2012

HI srselva,

Please find the below code. Just you need a little bit tweak in your xpath definition.

Code:
Browser("micclass:=browser").Page("micclass:=page").link("xpath:=//font[@id='addlang']/a[1]").click
or you can click on the link using below xpath too
Code:
Browser("micclass:=browser").Page("micclass:=page").link("xpath:=//a[contains(text(),'your link text value')]").click

Let me know if you need any more information.