Below is my HTML structure of page.
<tr>
<td class="checkCol">
<td align="center">
<td> 8 </td>
<td> Add </td>
<td>
<td> Route Translation </td>
<td title=""> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> Force Complete </td>
<td>
<td>
<td>
<td>
</tr>
I am using below code to retrieve the TD element values.
List<WebElement> numOfRows = sppOrder_table.findElements(By.tagName("tr"));
if (numOfRows.size() == 1) {
System.out.println("No Record");
} else {
// Excluding header row
for (int i = 1; i <= numOfRows.size() - 1; i++) {
List<WebElement> numOfColumns = ((WebElement) numOfRows.get(i)).findElements(By.tagName("td"));
for (WebElement td : numOfColumns) {
System.out.println("Column Value === "+td.getText());
}
}
My Table Xpath is correct. It is printing nothing using HTMLUNITDRIVE and working fine using Firefox. Please suggest the resolution for this issue.