I have the following HTML structure
<tr>
<td><input name="Choice" type="radio" value="someValue"></td>
<td><a href="">text</a></td>
</tr>
I would like to write a Xpath that finds the link by the value of its text then search the input element and perform an action like click on the input radio button.
I have tried a number of Xpaths like this one
//a[contains(text(), 'text')]/ancestor::/td/input
but they all fail. The first part of the xpath is right but the second path with the ancestor is where it gets into trouble.