Power BI Fundamentals - Create visualizations and dashboards from scratch
Save 40% on 3 months of Coursera Plus
Overview
Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Learn how to use locators in Playwright Java to find and interact with web page elements in this 28-minute tutorial. Explore various locator strategies including ID attributes, name attributes, CSS selectors, XPath expressions, and accessibility-based selectors through hands-on examples. Create a new test class called LocatorsDemo.java and implement a comprehensive testAllLocators() function that demonstrates locating form elements like text inputs, radio buttons, dropdowns, checkboxes, and buttons on a practice website. Master essential locator techniques such as using page.locator() with CSS selectors for first and last name fields, selecting radio buttons by value or using nth() for positional selection, handling dropdown menus with selectOption(), managing checkboxes through various selector methods, and utilizing XPath when necessary for date inputs. Discover modern Playwright features like getByText() for visible text matching, getByLabel() for form labels, and getByRole() with AriaRole for accessibility-compliant element selection. Practice with real examples including filling form fields, checking radio buttons and checkboxes, selecting dropdown options, and clicking buttons while following best practices for reliable web automation testing.
Syllabus
Playwright Java | Part 6 | Locators
Taught by
Automation Step by Step