简体   繁体   中英

Selenium IDE and Xpath object recognition

I am new to Selenium and world of testing. I have a query on identifying the objects using XPath/Firebug. I have a tree view which has folders and files when I click on any folder it recognizes with Node6...[n] etc. but I want to identify as its name and not Node. Here is the quick HTML code -

<a name="Node6" id="Node6" href="JAVASCRIPT:NodeClick(6, false );">Laptop Test</a>
<a name="Node7" id="Node7" href="JAVASCRIPT:NodeClick(7, false );">Laptop Main</a>

If I understand you correctly, you can use the following xpath:

//a[@name='Node6']

or

//a[text()='Laptop Test']

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM