Xpath error locator not found

137 views
Skip to first unread message

GindSingh

unread,
Jul 13, 2011, 7:32:19 PM7/13/11
to Selenium Users
Hey

I am getting this error message when I am trying to click on a link.
I've tested this with firebug and the link will come up, also if I
use //li/a[text()="o=test8"], it will go to the node but I cant get
further to the sibling

[error] locator not found: //li/a[text()="o=test8"]/following-
sibling::span/child::a[@class="delete"]

Please help

Mark Collin

unread,
Jul 14, 2011, 9:54:45 AM7/14/11
to seleniu...@googlegroups.com
Are you sure it is a sibling and not a descendant?

Hey

Please help

--
You received this message because you are subscribed to the Google Groups
"Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to
selenium-user...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/selenium-users?hl=en.


--
This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.

If you have received this email in error please notify postm...@ardescosolutions.com

Lutfi Dughman

unread,
Jul 14, 2011, 11:02:29 AM7/14/11
to seleniu...@googlegroups.com
if you wanna go to the sibling use the "/../" which takes you up tot he parent and then you can go back down to sibling

 //li/a[text()="o=test8"]/../IMG[2]  <-- this example takes you to the second IMG sibling

Mark Collin

unread,
Jul 14, 2011, 11:19:07 AM7/14/11
to seleniu...@googlegroups.com

Following-sibling can accept an index as well, so this shouldn’t really be a problem.

 

I personally prefer following/previous-sibling to walking up and down the tree, it look cleaner and clearer in code IMHO

Reply all
Reply to author
Forward
0 new messages