selector-strategies

Community

Resilient selectors for stable Playwright tests.

AuthorAbhiRKeesara
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill helps teams reduce flaky Playwright tests by teaching resilient, accessibility-first selectors that stay stable as the UI changes. It focuses on semantic locators over brittle CSS or XPath and encourages accessibility-minded test engineering practices.

Core Features & Use Cases

  • Accessibility-first selectors using getByRole, getByLabel, and getByPlaceholder to improve test stability and readability.
  • A clear priority hierarchy that guides testers away from brittle selectors and towards robust options.
  • Practical scenarios including form testing, navigation, dynamic content, and migration between testing frameworks.

Quick Start

  • Use getByRole for interactive elements like buttons and links.
  • Prefer getByLabel for inputs with visible labels; fall back to getByPlaceholder when labels are absent.
  • Use getByText cautiously for static, unique content; if not reliable, use getByTestId as a last resort.
  • Examples: page.getByRole('button', { name: 'Submit' }).click(); page.getByLabel('Email').fill('user@example.com'); page.getByPlaceholder('Enter your email').fill('user@example.com');

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: selector-strategies
Download link: https://github.com/AbhiRKeesara/test-automation-skills/archive/main.zip#selector-strategies

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.