I'm using xPath with FireFinder.. but can't seen to get the right xPath to find an element.. Sample html:
<input type="button" onclick="ViewContact('9498')" value="View Contact" class="FormButton">
<input type="button" onclick="ViewContact('9499')" value="View Contact" class="FormButton">
I can find both of these with:
//input[contains(@value,'View Contact')]
But if I want to find just one via the id, like:
//input[contains(@onclick,'ViewContact('9498')')]
won't work, I assume the apostrophes aren't escaped right.. tried without them:
//input[contains(@onclick,'ViewContact(9498)')]
This works:
//input[contains(@onclick,'9498') and contains(@onclick,'ViewContact')]
but i'd rather not have to use 2 clauses.. any way to do this in one contains ?
Duh...Thanks :) At least I didn't use my login :)
Any tools that can help figure this out instead of stubling around trying things ?
You can use this XPath:
//input[contains(@onclick,"ViewContact('9498')")]
精彩评论