Okay, given the following situation:
<tr>
<td> input="the wrong radio button" </td>
<td> the wrong title </td>
</tr>
<tr>
<td> input="the right radio button" </td>
<td> the right title </td>
</tr>
I have “the right title” already stored in a variable. How can I make Selenium click the right radio button?
The radios have dynamic id´s (e.g. foo_bar_4711) that aren ´t directly related with the title.
I would need something like “click the radio button in the tr that containts a td having the text you are looking for”.
You need an XPath locator that differentiates between the two buttons. Something like
xpath=tr[td[.='the right title']]//input. In English, that means “the input button contained within the table row that contains a table cell who’s text is ‘the right title’“.