Smart Locator Agent

Generate stable UI locators for Playwright, Selenium, and Appium.

129|51|Updated Mar 15, 2026
One-click install
npx skills add https://github.com/anhtester/antigravity-testing-kit --skill smart-locator-agent
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Smart Locator Agent
Source: https://github.com/anhtester/antigravity-testing-kit/tree/main/.agent/skills/smart_locator_agent
Command: npx skills add https://github.com/anhtester/antigravity-testing-kit --skill smart-locator-agent

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

UI automation often suffers from brittle locators that break with UI changes. This skill provides a systematic approach to generate stable, maintainable locators across web and mobile frameworks.

Core Features & Use Cases

  • Generate stable locators for Playwright, Selenium, and Appium with a consistent strategy.
  • Validate locator uniqueness and resilience against DOM updates, and provide a safe fallback locator.
  • Use cases include creating selectors for form fields, buttons, and dynamic elements across platforms.

Quick Start

Generate a stable locator for a login button with accessible attributes.

Frequently Asked Questions about Smart Locator Agent

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate stable UI locators to prevent brittle automation tests?

Generate stable UI locators by prioritizing accessibility attributes, data-* attributes, and IDs to ensure resilience. This systematic approach prevents brittle automated tests by validating uniqueness and providing a safe fallback locator for dynamic UI elements.

What is the best way to find maintainable selectors for dynamic elements across web and mobile?

The best way to find maintainable selectors is enforcing a priority scheme based on accessibility attributes and unique IDs. This approach applies across web and mobile platforms, validating locator uniqueness and generating a fallback locator for dynamic elements.

Does this locator strategy work with Playwright, Selenium, and Appium?

Yes, this locator strategy works with Playwright, Selenium, and Appium. It applies a consistent priority scheme across web and mobile frameworks, ensuring stable and maintainable locators for UI automation across different testing environments.

How do I avoid fragile selectors in UI automation?

Avoid fragile selectors in UI automation by systematically prioritizing accessibility and data-* attributes over structural DOM paths. Validating locator uniqueness and maintaining a fallback locator further prevents brittle automated tests during UI changes.

What happens if a primary UI locator breaks during a DOM update?

If a primary UI locator breaks during a DOM update, the strategy provides a safe fallback locator. It validates resilience against DOM updates by enforcing a priority scheme using accessibility attributes, data-* attributes, and IDs.

When should I use a fallback locator for UI automation elements?

Use a fallback locator for UI automation elements when primary selectors fail DOM updates. The strategy validates locator uniqueness and resilience, ensuring automated tests remain stable across web and mobile frameworks like Playwright and Selenium.