Pick the right locator.

Click any element on a page and get the Playwright locator to paste. Test IDs, roles, labels and text come first; CSS only when nothing better exists.

Free and open source under MIT. Works in Chrome, Edge and Firefox 140+. Download a build from GitHub Releases

app.example.com/login

Sign in

Use your work account.

Email Password

This is a working demo. Hover and click anything in the page.

How it chose that locator.

Pickwright tries these kinds of locator in Playwright's order of preference and keeps the first one that matches exactly one element. This is the run for the element you picked above: Sign in button. See the full priority table .

  1. 1 Test IDs nothing to use
  2. 2 What users see getByRole('button', { name: 'Sign in' }) used
  3. 3 IDs and attributes nothing to use
  4. 4 Page structure locator('button[type="submit"]') also unique

In your test

Lines marked + use the locator you picked.

login.spec.tsTypeScript
import { test, expect } from '@playwright/test'; test('user signs in', async ({ page }) => { await page.goto('/login'); await page .getByRole('textbox', { name: 'Email' }) .fill('ada@example.com'); await page.getByLabel('Password').fill('hunter2'); + await page + .getByRole('button', { name: 'Sign in' }) + .click(); await expect(page).toHaveURL('/dashboard'); });

Built for the apps you actually test.

  • Iframes at any depth

    Adds the frameLocator chain for you.

    frameLocator('#checkout').getByRole('button', { name: 'Pay' })
  • Pick a whole form

    Collect several elements in one go, then Copy all gives you a named list.

    getByLabel('Email'); // emailInput getByLabel('Password'); // passwordInput getByRole('button', { name: 'Sign in' }); // signInButton
  • Ignores framework noise

    Skips generated ids and classes like mat- and ng-reflect-, and uses formcontrolname instead.

    <input id="mat-input-3" formcontrolname="email"> locator('[formcontrolname="email"]')
  • Shadow DOM
  • Shift+click opens dropdowns
  • Alt+Shift+L starts picking
  • History stays on your machine
  • Chrome, Edge and Firefox 140+

Why not copy the selector from DevTools?

DevTools copies a path through the DOM. It works until the layout changes. Pickwright gives you the locator Playwright recommends.

DevTools: Copy selector
#root > div > main > form > button:nth-child(4)
Pickwright
getByRole('button', { name: 'Sign in' })
Aspect DevTools Pickwright
Breaks when the page layout or nesting changes the element's role, label or test ID changes
Framework noise copies generated ids and classes skips Angular mat-, cdk- and ng-reflect-* noise
Iframes and shadow DOM you write frameLocator() yourself adds the frameLocator() chain and reads open shadow roots
Several elements one copy at a time Pick multiple collects a named list
History none your last 20 picks, with the page they came from

Set up in under a minute.

Free, open source and MIT licensed. No account, no setup and no telemetry. Nothing you pick leaves your browser.

  1. 1

    Add it to your browser

    Install from the Chrome Web Store or Firefox Add-ons.

  2. 2

    Open your app

    Go to the page under test and click the Pickwright icon in the toolbar, or press Alt+Shift+L.

  3. 3

    Click, copy, paste

    Hover to highlight, click to pick, and paste the locator into your test.

Prefer to load it yourself? Get a build from GitHub Releases. On Chrome or Edge, unzip pickwright-chrome-*.zip and load the folder unpacked. On Firefox 140+, install the signed .xpi.

View source on GitHub