I am new to Selenium and am trying to iterate over a set of table rows to find the time (e.g 08:00) in the first cell and then populate the adjacent 4 cells.
I find the table using the following but it tells me that forEach is undefined.
driver.findElement(By.xpath("//body/div[2]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[2]/div[1]/table[1]/tbody/tr"))
.then(function (rows) {
forEach(rows=> {
});
})
This is the table structure.
<table class="deliveries" id="deliveries">
<tbody>
<tr>
<th colspan="5">Location: //dynamically added</th>
</tr>
<tr>
<td class="time">
<font>08:00</font>
</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td class="time">
<font>09:00</font>
</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td class="time">
<font>10:00</font>
</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td class="time">
<font>11:00</font>
</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td class="time">
<font>12:00</font>
</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
Any advice on how I can get to the cells adjacent to the 'time' cell?