Playwright + Java · Lesson 21 of 38

0/38 done

Module 21: Web Elements

21. Automating Complex UI Widgets: Tables, Dropdowns & Date Pickers

18 minlesson

Your task

Implement clickRowAction:

  1. Accept Page page, String orderId, and String actionName.
  2. Locate row in "tbody tr" that hasText(orderId).
  3. Click the button inside that row having accessible name actionName.

Write it in the editor, then press Check answer (Ctrl + Enter).

Automating Data Grids & Dynamic Tables

java
Locator tableRows = page.locator("table#orders-table tbody tr");
Locator targetRow = tableRows.filter(new Locator.FilterOptions().setHasText("ORD-9842"));
targetRow.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("View")).click();

Key Takeaways & Walkthrough Summary

Modern web applications feature rich dynamic widgets: data tables with pagination, searchable multi-selects, sliders, and calendars. In this lesson, you will learn robust patterns to automate complex web elements cleanly in Java. Let's tackle rich UI widgets!

Part of the Playwright + Java course (Playwright with Java). Practice this concept live in the Playwright Online Compiler or explore our free automation practice form.

Common Doubts & Lesson Q&A

How do I handle infinite scroll lists in Playwright Java?

Use page.mouse().wheel(0, 1000) or scroll the last element into view until the target item is attached.

Ready? Solve the task in the editor

Use Check answer to mark it complete. Hints are there if you need them.

Java
Skip