That’s my source I want to verify with selenium:
<tr class="myclass">
<td class="column" style="width:50%"> Key </td>
<td style="width:50%"> Value </td>
<td style="width:50%"> </td>
</tr>
I want to verify that he word “Values” is contained there.
Following statement always returns: “Key” instead of “Values”
driver.findElement(By.xpath("//tr[td[contains(text(), 'Key')]]/td")).getText();
What am I doing wrong? How can I get the text of my xpath expression?
Here try this
all the columns in the table are siblings. If you call them without array it will return the value of first one. Try td[2] if td[1] doesn’t work.