21. Automating Complex UI Widgets & Dynamic Lists

Data Grids & Dynamic Rows

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

// Auto-complete dropdown:
const searchInput = page.getByPlaceholder("Search country");
await searchInput.pressSequentially("Can", { delay: 100 });
await page.getByRole("option", { name: "Canada" }).click();

Task

  • Implement parseTableRowCells:
  • 1. Accept cells array of strings.
  • 2. Throw an Error if cells has fewer than 3 items.
  • 3. Return { id: cells[0], name: cells[1], role: cells[2] }.
πŸ’‘Common doubts
Did you like the problem?
Lesson 21 of 35
JavaScript
Loading code editor…
Next