Correcting Wrong ‘Playwright’s Advantage over Selenium” Part 9: “Playwright ARIA locator support”
It's better without an ARIA locator.
Continue to correct the 9th wrong claim in this YouTube video, “Playwright vs Selenium: What Advantages Make Playwright the Winner in Automation Testing Battle 🏆”.
This article series:
“Playwright Features Can be Configured in one Configuration” 👎🏽
“Playwright supports a range of Testing Types, e.g. API Testing, Component Testing, …” 👎🏽
Wrap Up
Claim 9: “Playwright ARIA locator support”
The video did not provide a heading for this claim, but it is included in the chapters.
Here are some phases from the video:
“most importantly, playwright does have what is called as an aria locator support which is completely not available with selenium;”
“Aria locators are very very easy to perform in UI identification and it’s much faster as well which completely not available in selenium”
The video did not show an example of his so-called “ARIA locator”. The page background in the video was “https://playwright.dev/docs/locators”, which contains no mention of the term “ARIA locator.” ARIA stands for Accessible Rich Internet Applications. It’s a set of attributes that can be added to HTML elements to help people who use assistive technologies, like screen readers, navigate and understand web content more easily.
Specifically, I think he meant “Role locators”.
“Role locators include buttons, checkboxes, headings, links, lists, tables, and many more and follow W3C specifications for ARIA role, ARIA attributes and accessible name. Note that many html elements like
<button>
have an implicitly defined role that is recognized by the role locator.” — playwright.dev/docs/locators
Again, the blogger did not get the basics right (See part 1 for his use of “Playwright uses Chrome Driver Protocol,” which does not exist; it shall be “Chrome DevTools Protocol.”), and started video blogging!
OK, let’s forgive his mistake. He meant “Role locators” (a.k.a. user-visible locators). But it is a bad sign; people can get confused with the locator name, don’t you agree?
Here are the simplest four role locator examples shown in the Playwright Quick Guide.
await page.getByLabel('User Name').fill('John');
await page.getByLabel('Password').fill('secret-password');
await page.getByRole('button', { name: 'Sign in' }).click();
await expect(page.getByText('Welcome, John!')).toBeVisible();
I think it is far worse than the Selenium WebDriver syntax, which was designed by world experts (at W3C) after many rounds of review. I have written one article on a detailed comparison between the two syntaxes.
Playwright vs Selenium WebDriver Syntax Comparison by Example
Keep reading with a 7-day free trial
Subscribe to AgileWay’s Test Automation & Continuous Testing Blog to keep reading this post and get 7 days of free access to the full post archives.