11. Automating Complex UI Widgets & Grids

Data Tables & Dynamic Lists

// Target specific row by text content:
const userRow = page.locator("table tbody tr", { hasText: "sara@targetqa.com" });
await userRow.getByRole("button", { name: "Edit" }).click();

// Extract all table cell texts:
const names = await page.locator("table tbody tr td:first-child").allInnerTexts();

Task

  • Implement parseTableData:
  • 1. Accept rows array of arrays [["1", "Alice"], ["2", "Bob"]].
  • 2. Return an array of objects [{ id: row[0], name: row[1] }].
πŸ’‘Common doubts
Did you like the problem?
Lesson 11 of 18
JavaScript
Loading code editor…
Next