← Back to all tools
selector tester

Test XPath & CSS selectors live, before you script them.

Paste your HTML, write a selector, and see exactly what it matches — catch broken locators before they break your Selenium or Playwright test.

HTML to test against
Paste HTML and write a selector to test it
Everything runs locally in your browser — your HTML is parsed on your device and never sent to a server. CSS selectors use querySelectorAll; XPath uses the browser's native document.evaluate, so behavior matches what Selenium/Playwright would see in a real browser context.
Frequently asked questions
Both point to elements on a page, just with different syntax. CSS selectors (like .title or #header) are shorter and faster to write, and are the standard choice in most modern test frameworks. XPath (like //div[@class="title"]) can do things CSS can't — like selecting an element by its exact visible text, or navigating to a parent element. Most testers default to CSS and reach for XPath only when they hit something CSS can't express.
The most common causes: a typo in a class or attribute name, mismatched case (CSS selectors and XPath are both case-sensitive), or the element genuinely isn't in the HTML you pasted — for example, if it's added dynamically by JavaScript after the page loads, it won't appear in a static HTML paste. Try copying a larger chunk of the page's HTML from DevTools to make sure the element is actually included.
Yes, for static HTML. This tool uses the same underlying engines your browser (and Selenium/Playwright, which drive real browsers) use — querySelectorAll for CSS and document.evaluate for XPath. The one thing to keep in mind: if the real page loads content dynamically via JavaScript, make sure you copy the HTML after that content has loaded, not the initial page source.
Open the real page in Chrome, right-click the element you care about, choose Inspect, find it highlighted in the DevTools panel, then right-click that highlighted line and choose Copy → Copy outerHTML. Paste that into the box above.
No. Everything happens in your browser — nothing you paste here is uploaded, logged, or stored on any server. You can safely test HTML from private or internal projects.