For Test Automation Engineers

Master XPath
Once and For All

Stop writing fragile locators. Learn to craft bulletproof XPath expressions with interactive tutorials, a live playground, and real-world challenges.

50+
Lessons
100+
Challenges
Free
Forever

Why XPathDecoded?

Everything you need to go from XPath confusion to XPath confidence.

Write Robust Locators

Learn patterns that survive DOM changes. Every example rated for stability so you know what's production-ready.

Interactive Playground

Test XPath expressions against real HTML in real-time. See matches highlighted, get instant feedback.

Practice & Master

Reinforce learning with MCQs, timed quizzes, and hands-on challenges. Track your progress as you improve.

Quick Recipes

Common XPath patterns ready to use. Click any recipe to try it in the playground.

Button by Text

medium

Find a button containing specific text

//button[contains(text(), 'Submit')]
Try it

Input by Label

stable

Find input associated with a label

//label[text()='Email']/following-sibling::input
Try it

By data-testid

stable

Target elements by test ID attribute

//*[@data-testid='login-button']
Try it

Table Cell by Header

medium

Find cell in a specific column

//table//tr/td[count(//th[text()='Price']/preceding-sibling::th)+1]
Try it

Nth Item in List

fragile

Select specific item from a list

(//ul[@class='items']/li)[3]
Try it

Parent to Child

medium

Navigate from parent to specific child

//div[@class='card']//h2
Try it

Sibling Navigation

medium

Find element relative to sibling

//h3[text()='Settings']/following-sibling::div[1]
Try it

Contains Class

medium

Match partial class names

//*[contains(@class, 'btn-primary')]
Try it

Common Questions