I want to locate the input based on the value of the previous td --> 143753 taking in consideration that i will put the value 143753 in a variable, so i can choose any row i want to select.
<td style="width:11%;">143753</td>
<td align="right" style="width:10%;">
<input type="submit" name="ctl00$cphContent$wucOrderPos$gvPOSSelection$ctl03$btnSelectPos" value="Select" id="cphContent_wucOrderPos_gvPOSSelection_btnSelectPos_1" class="button">
</td>
This screenshot will make what I want to do more clear:
My Attempt:
//*[@value="Select"]//preceding-sibling::td[@text()='143753']
Only contains(text(),'') worked for me for this case
//td[contains(text(),'174013')]/following-sibling::td/input[@value="Select"]