Problem : To identify uniquely a GUI element having a text "Enterprise Sample" within its <a> tag

Solution : The page source of the web page shows the element as  <a href="clickme.html">Enterprise Sample</a> . Use the below command in xpath checker to uniquely identify this element

 //a[contains(text(),"Enterprise")]

In layman's term, the above command will look 

  1. first for all occurrence of <a> tag within the web page
  2. then matches the value of <a> tag with user's text (here "Enterprise")

 

 

 

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed

This blog copyright 2009 by thekkadath