locators
Reference rules for choosing resilient Playwright locators — priority order, scoping, iframes, shadow DOM, dynamic lists, tables and strictness errors.
Skill by rinkucool007
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/rinkucool007-locators
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: frontend, testing, writing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/locators
What's inside
- Skill name
locators- Description
- Reference rules for choosing resilient Playwright locators — priority order, scoping, iframes, shadow DOM, dynamic lists, tables and strictness errors. Use whenever writing or fixing a Playwright locator/selector, when a test fails with "strict mode violation" or "element not found", or when converting brittle XPath/CSS selectors.
- License
- MIT
- Instructions
- 38 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Locator playbook
## Priority (highest first)
1. `page.getByRole('button', { name: 'Save' })` — mirrors how users & assistive tech see the page
2. `page.getByLabel('Email')` — form fields
3. `page.getByPlaceholder('Search')`
4. `page.getByText('Order confirmed')` — static, user-visible text; use `{ exact: true }` or regex when needed
5. `page.getByAltText` / `getByTitle`
6. `page.getByTestId('checkout-submit')` — when semantics are poor; set `testIdAttribute` in config if the app uses `data-qa`, `data-cy`, etc.
7. Scoped CSS: `page.locator('[data-section="billing"]').getByRole('textbox')` — last resort
**Never**: absolute XPath, `nth-child`, auto-generated classes (`css-1k9a`, `sc-bdVaJa`, `MuiBox-root-123`), text that includes dynamic numbers/dates.
## Scoping & filtering
```ts
const row = page.getByRole('row').filter({ hasText: 'INV-1042' });
await row.getByRole('button', { name: 'Pay' }).click();
const card = page.getByRole('listitem').filter({ has: page.getByRole('heading', { name: 'Pro plan' }) });
const dialog = page.getByRole('dialog', { name: 'Confirm delete' });
await dialog.getByRole('button', { name: 'Delete' }).click();
```
## Strict-mode violations
Cause: locator matches >1 element. Fix by scoping to a container, `filter({ hasText })`, `{ exact: true }`, or role + name. Use `.first()` only when order is semantically meaningful (e.g. "latest notification").
## Special surfaces
- **iframes**: `page.frameLocator('iframe[title="Payment"]').getByLabel('Card number')`
- **Shadow DOM**: Playwright CSS/role locators pierce open shadow roots automatically.
- **New tab**: `const [popup] = await Promise.all([page.waitForEvent('popup'), link.click()]);`
- **Downloads**: `const dl = page.waitForEvent('download'); await btn.click(); await (await dl).saveAs(path);`
- **File upload**: `await page.getByLabel('Upload').setInputFiles('fixtures/file.pdf');`
- **Native dialogs**: `page.once('dialog', d => d.accept());` before the triggering click.
- **Canvas / charts**: assert on the data source (API response via `page.waitForResponse`) or aria labels; screenshot comparisons only as a last resort.
## Assertions that auto-wait
`toBeVisible, toBeHidden, toBeEnabled, toBeChecked, toHaveText, toContainText, toHaveValue, toHaveURL, toHaveTitle, toHaveCount, toHaveAttribute, toHaveClass, toHaveScreenshot`, and `expect.poll(fn)` for non-DOM values. Use `expect.soft` to collect several checks in one step.From rinkucool007/playwright-autopilot, MIT.
More from rinkucool007/playwright-autopilot
- 0.565score
api-testing
rinkucool007
Write Playwright API tests and hybrid UI+API tests using the request fixture — REST/GraphQL calls, schema checks, auth tokens, network mocking with…
SkillAFreshness: AClaude Code +9 - 0.565score
generate
rinkucool007
Quickly write Playwright tests for a described scenario or recorded steps without the full lifecycle — plans inline, uses existing page maps if present…
SkillAFreshness: AClaude Code +9 - 0.565score
pom-fixtures
rinkucool007
Conventions for Playwright Page Object Model classes, custom fixtures, test data factories, auth storageState and API-based setup.
SkillAFreshness: AClaude Code +9 - 0.565score
ci
rinkucool007
Generate CI pipelines for Playwright — GitHub Actions (default), Azure DevOps, GitLab CI or Jenkins — with sharding, browser caching, HTML/JSON report…
SkillAFreshness: AClaude Code +9 - 0.565score
setup
rinkucool007
Bootstrap or repair a Playwright Test project (TypeScript or JavaScript) with best-practice config, fixtures, page-object folders, env handling and auth setup…
SkillAFreshness: AClaude Code +9 - 0.565score
e2e
rinkucool007
Main orchestrator for end-to-end Playwright test creation.
SkillAFreshness: AClaude Code +9 - 0.559score
review
rinkucool007
Audit an existing Playwright test suite (or specific specs) for coverage, locator quality, assertion strength, isolation, flakiness risk and hard-coded…
SkillAFreshness: AClaude Code +9 - 0.559score
status
rinkucool007
Show the current or a past playwright-autopilot run — phase, heal budget, artifacts and the reasoning trail.
SkillAFreshness: AClaude Code +9 - 0.559score
explore
rinkucool007
Explore a live web page or flow with a real browser and produce a verified page map of resilient Playwright locators, without writing tests.
SkillAFreshness: AClaude Code +9 - 0.559score
heal
rinkucool007
Diagnose and fix failing or flaky Playwright tests in an existing suite using the executor → healer loop with root-cause classification, without weakening…
SkillAFreshness: AClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Sep 30, 2026 (29 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from rinkucool007
- 0.565score
api-testing
rinkucool007
Write Playwright API tests and hybrid UI+API tests using the request fixture — REST/GraphQL calls, schema checks, auth tokens, network mocking with…
SkillAFreshness: AClaude Code +9 - 0.565score
generate
rinkucool007
Quickly write Playwright tests for a described scenario or recorded steps without the full lifecycle — plans inline, uses existing page maps if present…
SkillAFreshness: AClaude Code +9 - 0.565score
pom-fixtures
rinkucool007
Conventions for Playwright Page Object Model classes, custom fixtures, test data factories, auth storageState and API-based setup.
SkillAFreshness: AClaude Code +9 - 0.565score
ci
rinkucool007
Generate CI pipelines for Playwright — GitHub Actions (default), Azure DevOps, GitLab CI or Jenkins — with sharding, browser caching, HTML/JSON report…
SkillAFreshness: AClaude Code +9 - 0.565score
setup
rinkucool007
Bootstrap or repair a Playwright Test project (TypeScript or JavaScript) with best-practice config, fixtures, page-object folders, env handling and auth setup…
SkillAFreshness: AClaude Code +9 - 0.565score
e2e
rinkucool007
Main orchestrator for end-to-end Playwright test creation.
SkillAFreshness: AClaude Code +9
Cite this page
locators skill. Agent Mart. https://agentmart.dev/skills/rinkucool007-locators (last updated 2026-10-24)