clue for xpath following?

21 views
Skip to first unread message

Chris McMahon

unread,
Oct 14, 2011, 2:06:54 PM10/14/11
to selenesse-users

Hi,

I have these lines in selenesse, and I've tried this in SeIDE also
with the same result:

| click | //input[@value='Edit']//following::span[.='desc'] |
| click | //input[@value='Edit'] |

Both lines show green in Fitnesse, so Se recognizes the element, but
only the line without the "following" actually clicks anything.

It's been some time since I've used xpath following, I wonder if
there's something I'm missing.

Thanks,
-Chris

Marisa Seal

unread,
Oct 14, 2011, 2:17:28 PM10/14/11
to selenes...@googlegroups.com
As it is written, your xpath will select the span with innertext 'desc' that follows the input tag. I'm assuming that the span is the label for the input field you're trying to select, so I would think that label would precede the input. 

Try

//span[.='desc']//following::input[@value='Edit']

Also, XPath Checker is a handy tool that I use to test my xpath expressions: https://addons.mozilla.org/en-US/firefox/addon/xpath-checker/
--
Marisa

Chris McMahon

unread,
Oct 14, 2011, 2:23:58 PM10/14/11
to selenes...@googlegroups.com


Thanks!
Reply all
Reply to author
Forward
0 new messages