Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Playwright Java - Locators - Part 6

Automation Step by Step via YouTube

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

Reviews

Start your review of Playwright Java - Locators - Part 6

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.