Iterate All Table Data
Loop through all rows and cells to extract complete table data.
Row/Cell Structure:
<tbody>
<tr>
<td>John Smith</td> <!-- cells.get(0) = Name -->
<td>30</td> <!-- cells.get(1) = Age -->
<td>Engineering</td> <!-- cells.get(2) = Department -->
<td>$80,000</td> <!-- cells.get(3) = Salary -->
</tr>
<tr>
<td>Jane Doe</td>
<td>25</td>
<td>Marketing</td>
<td>$65,000</td>
</tr>
<!-- ... more rows ... -->
</tbody>
Task:
- Navigate to
https://testkru.com/Elements/Tables
- Get the first 3 employee names from the employeeTable
- For each, print the name and their department
Expected output:
John Smith - Engineering
Jane Doe - Marketing
Bob Johnson - Sales