Why XPath Tester?
XPath is where automation scripts go to die: the expression looks right, the tool says "no match", and you are left guessing whether the path, the namespace, or the document is wrong. This tester evaluates real XPath 1.0 against your actual XML or HTML, shows every match in document order, and highlights them in the document - so the next failure is a fix, not a debugging session.
- Namespaces are the number one cause of "no match": prefixes declared on the root (xmlns:bk=...) are detected automatically, but add them in the namespace box if you use an undeclared prefix.
- Start from the root with absolute paths (/catalog/book) when the document is small, then relax to //book once you confirm the structure.
- Use the HTML mode to validate Selenium/Playwright locators against a saved page - attribute matches highlight the element that owns them.
- Pair it with the XML Formatter when a payload is unreadable, and the Regex Tester when the target is free text inside a node.
What is XPath Tester?
XPath Tester evaluates XPath 1.0 expressions against XML or HTML documents right in your browser. Paste a document, write an expression, and get live matches in document order with serialized snippets, plus scalar results for string(), number(), and boolean() expressions. Namespace prefixes are auto-detected from the document (and can be overridden), so queries against SOAP payloads, RSS feeds, or any namespaced XML work without ceremony. Everything runs locally — your documents and expressions never leave the page.
Common Use Cases
SOAP & XML API Testing
Extract fields from SOAP responses or XML API payloads and verify the path you plan to use in assertions or transformations.
Test Automation Locators
Validate XPath locators for Selenium, Playwright, or Appium before committing them to your test suite — including HTML documents in HTML mode.
Scraping & Data Extraction
Prototype XPath queries against scraped HTML or XML exports to confirm the exact nodes your pipeline will read.
XSLT & Config Debugging
Check that selectors in XSLT stylesheets, Jenkins pipelines, or Spring configs match the actual document structure.
How to Use This Tool
- Paste an XML or HTML document (or load a sample to see the workflow)
- Write an XPath 1.0 expression and press Enter or click Evaluate
- Namespaces declared in the document are detected automatically — add or override prefixes in the namespace box if needed
- Review matches in document order, copy snippets for test reports, or toggle "Highlight in document" to see exactly what matched
Related Tools
Learn More
- MDN — XPath Official reference for XPath syntax, axes, and functions.
- W3C — XML Path Language 1.0 The XPath 1.0 specification this tool implements.