Reputation: 69
I need to select the next input field and the A
field, following the active page (class="active_page")
on the two sample HTML code below, but the following two XPath are not working.
How would I accomplish the following-sibling
and what is the easiest way of doing this?
//*[@id="pagination"]/ul/li[2]/a/following-sibling::A[1]
<div id="pagination">
<ul class="zPagination">
<li><a href="https://www.test.com/page&pagination=10">«</a></li>
<li><a class="active_page" href="https://www.test.com/page&pagination=10">1</a></li>
<li><a href="https://www.test.com/page&pagination=10">2</a></li>
<li><a href="https://www.test.com/page&pagination=10">3</a></li>
<li><a href="https://www.test.com/page&pagination=10">»</a></li>
</ul>
</div>
//TABLE[@class='table-striped']/TBODY[1]/TR[1]/TD[1]/INPUT[1]/following-sibling::INPUT[1]
<table class="table-striped">
<tbody>
<tr>
<td><input id="selection" style="width: 20px;" name="test" class="zeroborder" value="001" type="radio"> </td>
<td>S</td>
</tr>
<tr>
<td><input id="selection" style="width: 20px;" name="test" class="zeroborder" value="002" type="radio"> </td>
<td>S</td>
</tr>
<tr>
<td><input id="selection" style="width: 20px;" name="test" class="zeroborder" value="003" type="radio"> </td>
<td>S</td>
</tr>
</tbody>
</table>
Upvotes: 1
Views: 615
Reputation: 111541
There are (at least) two errors with your XPaths:
following-siblings
a
or input
elements. Perhaps
you meant just following
.Upvotes: 2