I have the following html:
<table id="oTable">
<tbody>
<tr mote.id="12345">
<td>Status</td>
<td>1</td>
</tr>
<tr mote.id="54321">
<td>Status</td>
<td>2</td>
</tr>
</tbody>
I want to locate the row with mote.id and click the first td-tag
WebElement element = getDriver().findElement(By.xpath("//tr[@mote.id='12345']/td[1]"));
But I get the following Error:
Bad token, expected: ] got: .
To locate the <td> element, use :
WebElement element = getDriver().findElement(By.xpath("//td[contains(text(),'Status')]"));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With