I have a table, which is dynamic (so I can't use strict locator or paths)

<tr class="odd" role="row">
<td class="sorting_1">
<td>12/28/2016 04:13:10</td>
<td class=" checkbox-cell width-to-content">
<div class="checkbox">
<input class="mass-action" name="mass-action" value="" type="checkbox"/>
<span class="checkbox-material">
<span class="check"/>
<tr class="even" role="row">
<tr class="odd" role="row">
<tr class="even" role="row">

I've tried to solve it in two steps, like this:

WebElement row = tableBody.findElement(
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?

1 Answer 1


Assuming that you want to select the span element with the class check.
You need to search for the tr that contains your text and continue from there.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.