Playwright + JS · Lesson 21 of 35
Module 21: Web Elements
Try it yourself
Implement parseTableRowCells:
The editor has a worked example. Read it, tweak it, then press Mark as complete.
// 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();Modern web applications are filled with complex widgets like data tables, auto-complete dropdowns, date pickers, and infinite scrolling lists. In this lesson, we will learn reliable automation patterns to interact with dynamic web components smoothly. Let's tackle complex UI elements!
Part of the Playwright + JS course (Playwright with JavaScript). Practice this concept live in the Playwright Online Compiler or explore our free automation practice form.
You can fill the slider input if it is an <input type='range'>, or dispatch keyboard ArrowRight/ArrowLeft events.
Finished reading?
Review the worked example in the editor, then mark the lesson complete.