LearnFree QA courses with practical knowledge checks
PilotForge by SoftwareTestPilot

XPath & CSS playground

Test selectors against your HTML. Inspect real matches, compare alternatives and build more resilient locators — free, in your browser.

Local processing · no script execution
CSS and XPath 1.0 · core tool is free

HTML source

569 bytes
Source changed — analyze to refresh results.

Pasted scripts never run. Preview styles and remote content are stripped. Use redacted or synthetic HTML.

Selector analysis

Isolated HTML preview

Test more than the happy path

Try a unique selector, a duplicate match, an absent target and an invalid expression. A single result is useful only when it identifies the intended element. Positional selectors deserve extra scrutiny after layout changes.

Source DOM, not a live browser session

Analysis includes the parsed source, including hidden nodes, but not JavaScript-created state, computed stylesheet visibility, live shadow roots or iframe documents. XPath attribute/text matches are valid results but cannot be highlighted as page elements. XPath 1.0 and standard browser CSS syntax are supported; framework-only selectors are not.

Use browser DevTools or your automation runner to confirm interaction readiness. MDN XPath documentation and Playwright’s locator guidance explain supported syntax and semantic choices.

Selector playground questions

1.Which XPath features work here?
The tool uses your browser’s native XPath 1.0 engine: axes such as ancestor, following-sibling and descendant; predicates; contains, starts-with, normalize-space, count, string and boolean. XPath 2.0/3.0 functions and Playwright-specific selector syntax are not supported. The svg and xhtml prefixes have namespace resolvers.
2.Does this tool execute pasted scripts or load images?
No. Analysis uses a detached parsed document. The display is a separate sanitized copy inside a sandboxed iframe with a restrictive Content Security Policy. Scripts, remote resources, frames, source styles and form actions are blocked. Counts refer to the source DOM, not to a live website.
3.Can it inspect Shadow DOM and iframe contents?
No. A pasted document has no live shadow roots or loaded frame documents. XPath does not pierce shadow roots. Browser CSS queries here do not traverse shadow roots or frames. Paste a frame’s HTML separately; use frameLocator or switchTo().frame() in your real tests. Declarative shadow templates are not expanded.
4.Are accessible names and Playwright suggestions verified?
Accessible names use the standard dom-accessibility-api algorithm against the detached source. Stylesheets and live rendered state are not available, so confirm visibility and accessible names in your running app. CSS/XPath counts are measured here; Playwright suggestions are generated candidates, not executed Playwright locators.
5.Why does valid HTML appear different in the preview?
DOMParser repairs malformed HTML using browser parsing rules, including implied body and table structure. Preview sanitization strips unsafe or network-loading content and source styles. Nodes removed by sanitization can still be reported as source matches but cannot be highlighted.
6.Is core selector analysis free?
Yes, including upload, native CSS/XPath analysis, inspection, comparison and CSV/JSON export. Future batch analysis is not implemented, and no Pro paywall is enabled. Local limits are 500 KB of HTML, 10,000 elements and 4,000 selector characters for browser responsiveness.