Chrome Extension · Free to Use

The Smartest XPath, CSS & Playwright Locator Generator

45+ selector patterns. Stability scoring. Playwright locators. Batch verification & page scanning.
Built for test automation engineers who need reliable locators — not guesswork.

45+ Selector Patterns
3 Locator Types (XPath/CSS/Playwright)
5 Panel Tabs

45+ Selector Patterns

Generates XPath and CSS selectors across 10+ categories — ID, class, attribute, text, parent-child, sibling, and more. Always gives you options.

Stability Scoring

Every selector gets a score from 0–100. Instantly see which locators are Stable, Moderate, or Fragile — so your tests don't break on the next deploy.

Playwright Locators

Native Playwright locators like getByRole, getByTestId, getByLabel, getByText — ready to copy into your test code.

Everything You Need for Reliable Selectors

XPath Forte doesn't just give you one XPath. It generates selectors across every useful strategy.

Element Inspector

Click Any Element. Get Every Locator.

Click the extension icon to activate inspection mode. Hover over any element on the page to see its tag, ID, class, and attributes highlighted in real time. Click to select — and XPath Forte instantly generates every viable selector.

  • Real-time element highlighting on hover
  • Works across frames and iframes
  • No dev tools required
  • One-click copy for any selector
Element Selected: <button>
92 //button[@data-testid='submit-btn']
85 //button[@id='submitForm']
58 //form[@class='login']//button[1]
25 /html/body/div[3]/form/button
XPath Generation

10+ Categories, 45+ Patterns

Every element gets analyzed through multiple selector strategies so you always have the best option available.

ID & Class
Attributes
Text-based
Parent & Ancestor
Sibling
Multi-attribute
Label-associated
Collection/Index
Normalize-space
Contains & Starts-with
@ ID / Class @id, @class, contains(@class)
# Attributes name, role, aria-label, data-testid
T Text text(), contains(), starts-with()
Ancestor ancestor::, parent::, multilevel
Sibling following-sibling::, by tag+text
+ Multi-attr class+attr, ID+attr, name+attr
CSS Selectors

Not Just XPath — CSS Selectors Too

XPath Forte generates CSS selectors alongside XPath, covering all the patterns your tests might need.

  • ID and class-based selectors
  • data-testid, data-test, data-cy, data-qa
  • Name, role, and placeholder selectors
  • Combined attribute selectors
CSS Selectors
95 #submitForm
92 [data-testid="submit-btn"]
80 button.btn-primary
65 form.login > button
Smart Detection

Automatically Detects Unstable IDs

Many frameworks generate dynamic IDs that change on every build. XPath Forte recognizes and filters them automatically.

JSF j_idt88 Angular ng-content Vue data-v- Styled Components Material-UI Ember

Also detects UUIDs, hex hashes, and high-digit-ratio strings — so you never copy a selector that will be stale tomorrow.

j_idt88:j_idt91:input JSF dynamic
sc-bdVTJa dKpMkN Styled Comp hash
data-v-4a3f2b1c Vue scoped
submit-button Stable ID

How It Works

Three steps. Zero configuration.

1

Click the Extension Icon

Activates inspection mode on the current page. Elements highlight as you hover over them.

2

Click Any Element

XPath Forte generates 45+ XPath and CSS selectors with stability scores for the selected element.

3

Copy or Test Selectors

Copy any selector with one click, test it live in the panel, or scan the entire page for all interactive elements.

Stability Scoring

Know which locators will break — before they do.

70 – 100

Stable

Reliable across deployments. Prefer these selectors for CI/CD pipelines.

@data-testid @id (stable) @aria-label
45 – 69

Moderate

Usable but may need maintenance. Review before relying on in critical flows.

class-based text contains parent-child
0 – 44

Fragile

Likely to break. Avoid in automated tests. XPath Forte warns you before you copy.

absolute paths index-based deep nesting

What the scoring engine checks:

Deep nesting (>6 levels) — capped at 35
Position-based selectors — capped at 40
Absolute paths from html/body — capped at 20
Sibling relationships — capped at 50
data-testid attributes — scored 92+
Stable IDs — scored 85+
Semantic attributes (role, aria-label) — scored 75+

Advanced Features for Modern Web Apps

Playwright locators, batch verification, page scanning, Shadow DOM & iframe support.

Playwright Tab

Native Playwright Locators

Generate Playwright's recommended locators that work seamlessly with your test code.

  • getByRole() — buttons, links, checkboxes by ARIA role
  • getByTestId() — data-testid, data-test, data-cy, data-qa
  • getByLabel() — form fields by associated label
  • getByPlaceholder() — inputs by placeholder text
  • getByText() — elements by visible text
Playwright Locators
95 getByTestId('submit-btn')
90 getByRole('button', { name: 'Submit' })
85 getByLabel('Email address')
70 getByText('Sign Up', { exact: true })
Heal Tab

Batch Verify Existing Selectors

Paste your existing selectors — XPath, CSS, or Playwright — and verify them all against the current page in one click.

  • Paste multiple selectors (one per line)
  • Instant pass/fail status for each
  • Detects broken selectors before your CI does
  • Shows match count for non-unique selectors
//button[@data-testid='submit'] ✓ Unique
#btn-primary ⚠ 3 matches
//input[@id='old-form-field'] ✗ Broken
Scan Tab

Scan Entire Page for Locators

Automatically find all interactive elements on the page and get the best locator for each — perfect for building page objects from scratch.

  • Finds buttons, links, inputs, form controls, ARIA widgets
  • Picks the best locator (Test ID > ID > Role > Name)
  • Copy All — one-click copy entire locator list
  • Download — export as a text report
Page Scan Results (127 elements)
<button> getByTestId('login-btn')
<input> getByLabel('Email')
<a> #signup-link
<select> [name="country"]
Shadow DOM & iframe

Works Inside Shadow DOM & iframes

Modern web apps use Shadow DOM and iframes extensively. XPath Forte handles both seamlessly.

  • Piercing CSS selectors with >>> syntax
  • Automatic iframe detection and prefix
  • Deep search across all open shadow roots
  • Context menu works inside iframes
Shadow DOM Piercing
88 my-component >>> .inner-btn
65 #host >>> [slot="action"]

Start Writing Better Locators Today

Free to use. Install XPath Forte and stop fighting flaky selectors.