Read Table Headers
HTML tables use <th> for header cells. Use findElements() to get all headers.
On the Tables page, the employee table (id="employeeTable") has headers: Name, Age, Department, Salary.
HTML Table Structure:
<table id="employeeTable">
<thead>
<tr>
<th>Name</th>
<th>Age</th>
<th>Department</th>
<th>Salary</th>
</tr>
</thead>
<tbody>
<tr><td>...</td><td>...</td><td>...</td><td>...</td></tr>
<!-- 5 data rows -->
</tbody>
</table>
Task:
- Navigate to
https://testkru.com/Elements/Tables
- Find the employeeTable
- Get all
<th> elements
- Print each header text
Expected output:
Header 1: Name
Header 2: Age
Header 3: Department
Header 4: Salary