Rayrun
← Back to videos

Playwright new Locators | GetBy | Version 1.27 | Playwright Tutorial - Part 83

Locators

This blog post discusses a new update from Playwright, a software testing library. The author starts by expressing confusion about the removal of locators from Playwright, but soon learns that new additional locators have been added to make writing locators easier. The author describes some of these new locators, including "get by text," "get by label," "get by placeholder," and "get by role."

To demonstrate the usage of these locators, the author provides a detailed example of a test script. They navigate to a website, click on a login link, enter a username and password, click on a login button, search for a book, and click on the book's details. The author uses the new locators to select elements such as the login link, username label, password label, search placeholder, and book cover image.

The author then discusses the integration of tracing in Playwright and how it can be used to verify the correctness of locators. They enable tracing in the Playwright configuration file and run the test script again. The author demonstrates how tracing can show the steps taken by the script and validate the locators used.

The author concludes the blog post by expressing their excitement about the new update and the ease of writing locators with Playwright. They encourage readers to try it out and invite them to ask any questions in the comments or their Discord server.

Related Videos

MORE PLAYWRIGHT UI MODE UPDATES!! (Amazing VSCode Extension improvement!)
MORE PLAYWRIGHT UI MODE UPDATES!! (Amazing VSCode Extension improvement!)
#16 - ARIA and how Playwright is making use of it to identify UI controls?
#16 - ARIA and how Playwright is making use of it to identify UI controls?
Playwright - Set timeout, parallelisation and retries directly in your test files
Playwright - Set timeout, parallelisation and retries directly in your test files
Element Handle VS Locator API | Playwright Tutorial - Part 47
Element Handle VS Locator API | Playwright Tutorial - Part 47
TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.