I am automating a web system using selenium webdriver, in multiple scenarios I need to assert that given data in in one line (tr) of the web page.
For example, I need to assert that there is in the system a line (tr) with these data: Data 1, Data 2, Data 3, Data 4
And my page is structured like this:
<tr>
<td>Data 1</td>
<td>Data 2</td>
<td>Data 3</td>
<td><span class='something'>Data 4</span></td>
<tr>
I wrote this xpath hoping it would return the table row:
.//tr[td[text()='Data 1']]/parent::tr/td[text()='Data 2']/parent::tr/td[text()='Data 3']/parent::tr/td[text()='Data 4']
It works until Data 3
but in Data 4 does not work