Chrome Extension · Free to Use

The Smartest XPath & CSS Selector Generator for Test Automation

45+ selector patterns. Stability scoring. POM code snippets.
Built for Selenium & Playwright engineers who need reliable locators — not guesswork.

45+ Selector Patterns
10+ XPath Categories
8 Language + Framework Combos

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.

POM Code Snippets

One click generates ready-to-paste Page Object Model code for Selenium and Playwright in Java, Python, JavaScript, and C#.

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 Generate Code

Copy any selector with one click, or generate POM code snippets for your framework and language.

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+

Page Object Model Code — Ready to Paste

Select an element and get instant POM snippets for your framework and language.

// Selenium + Java
@FindBy(xpath = "//button[@data-testid='submit-btn']")
private WebElement submitButton;

@FindBy(css = "[data-testid='submit-btn']")
private WebElement submitButtonCss;

Selenium WebDriver

JavaPythonJavaScriptC#

Playwright

JavaPythonJavaScriptC#

Start Writing Better Locators Today

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