Skip to content
CodeKruPro

Iterate Table Data

67/70

Iterate Table Data

Combine .all() with locator chaining to iterate rows and cells.

Task:

  1. Navigate to https://testkru.com/Elements/Tables
  2. Get all data rows from the employee table
  3. For each row, get the name (first td) and age (second td)
  4. Print only the first 3 employees

Expected output:

John Smith - 30
Jane Doe - 25
Bob Johnson - 35