with one click
xpath-testing
// Interactive XPath testing against HTML files in test-data/. Find elements by iteratively querying XPath expressions. Use when this capability is needed.
// Interactive XPath testing against HTML files in test-data/. Find elements by iteratively querying XPath expressions. Use when this capability is needed.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | xpath-testing |
| description | Interactive XPath testing against HTML files in test-data/. Find elements by iteratively querying XPath expressions. Use when this capability is needed. |
| metadata | {"author":"testomatio"} |
Test XPath expressions against HTML files in test-data/ to find specific elements. You play a "game" — given a user's request, iteratively query XPath until you find the right element and a unique XPath for it.
test-data/ to see what's availableAsk the user:
test-data/? (list files if needed)Start with broad XPath patterns to understand the page:
bun .claude/skills/xpath-testing/xpath-query.ts test-data/<file> "//button"
bun .claude/skills/xpath-testing/xpath-query.ts test-data/<file> "//a[@href]"
bun .claude/skills/xpath-testing/xpath-query.ts test-data/<file> "//*[@role]"
Use the tool output to refine your XPath until you find the target element. Run as many queries as needed.
Once you find the element, present:
MANDATORY: Run the tool one final time with your unique XPath to confirm it returns exactly 1 result. If it returns more than 1, refine further.
bun .claude/skills/xpath-testing/xpath-query.ts <html-file> <xpath-expression>
Exit codes:
0 — elements found1 — no matches2 — invalid XPath or error//button All buttons
//a[@href] All links with href
//input All inputs
//select All select dropdowns
//form All forms
//*[@role='button'] Elements with button role
//*[@role='link'] Elements with link role
//*[@role='navigation'] Navigation landmarks
//*[@aria-label] Elements with aria-label
//*[@aria-label='Close'] Specific aria-label
//*[@aria-expanded='true'] Expanded elements
//input[@type='email'] Email inputs
//input[@name='username'] Input by name
//*[@id='main-content'] Element by ID
//*[contains(@class, 'btn')] Class contains "btn"
//*[starts-with(@id, 'user-')] ID starts with "user-"
//*[text()='Submit'] Exact text match
//*[contains(text(), 'Save')] Text contains "Save"
//button[contains(., 'Delete')] Button containing "Delete" (includes descendants)
//a[normalize-space()='Login'] Link with normalized text "Login"
//form//input[@type='email'] Email input inside a form
//nav//a[@href] Links inside nav
//table//tr Table rows
//*[@role='dialog']//button Buttons inside dialogs
//ul/li Direct child list items
//div[@class='modal']//input Inputs inside modal div
(//button)[1] First button
(//button)[last()] Last button
//ul/li[position()<=3] First 3 list items
//table//tr[2]/td[3] Cell at row 2, col 3
//input[@type='text' or @type='email'] Text or email inputs
//button[not(@disabled)] Non-disabled buttons
//*[@role='button' and @aria-label] Buttons with aria-label
Converted and distributed by TomeVault — claim your Tome and manage your conversions.