Skip to content

Tips and tricks

SchnuckySchuster edited this page Feb 1, 2013 · 3 revisions

HTML


When you need to find a sibbling using xpath

XPath Axes: An axis defines a node-set relative to the current node.
Suppose you have a site looking like this (in HTML):
<div id='Row_5_Text'>Element row 5</div>
<div id='Row_5_Icon'> <img src="images/someIcon.png"></div>
Suppose you need to click on the image that belongs to the row that holds the text "Element row 5", this is the xPath locator you need to use:
.//div[text() = "Element row 5"]/following-sibling::div

More information to XPath Axes

Clone this wiki locally