How this works?
How the playground parses locators and resolves them against your HTML.
Paste your HTML
Drop in any HTML snippet from your app. The playground parses it in your browser so your markup never leaves your machine.
Type a locator expression
Enter any Playwright locator: getByRole, getByText, getByLabel, getByTestId, locator with a CSS selector, or locator with an XPath expression.
See matches instantly
The tool resolves the locator against your HTML and shows a match count. One match means a unique, stable locator. More than one means you need to narrow it.
Copy a cleaner alternative
When your locator matches, the playground suggests up to three better alternatives ranked by Playwright best practices. Copy any suggestion straight into your test.
More free tools for Playwright teams
FAQs
getByRole, getByText, getByLabel, getByPlaceholder, getByTestId, getByAltText, getByTitle, locator with a CSS selector, and locator with an XPath expression via the xpath= prefix.
