I have a table, which is dynamic (so I can't use strict locator or paths)
<tbody>
<tr class="odd" role="row">
<td>Company</td>
<td class="sorting_1">
<td>22222@222222</td>
<td>0</td>
<td>0</td>
<td>
<td>12/28/2016 04:13:10</td>
<td class=" checkbox-cell width-to-content">
<div class="checkbox">
<label>
<input class="mass-action" name="mass-action" value="" type="checkbox"/>
<span class="checkbox-material">
<span class="check"/>
</span>
</label>
</div>
</td>
</tr>
<tr class="even" role="row">
<tr class="odd" role="row">
<tr class="even" role="row">
</tbody>
I've tried to solve it in two steps, like this:
WebElement row = tableBody.findElement(
By.xpath("//*[contains(text(),'222222@222222')]/parent::tr"));
WebElement targetEl = row.findElement(By.className("check"));
But this solution is terrible and totally ineffective.
Can anyone suggest some ideas how to make it more effectively?