Press "Enter" to skip to content

XPath cheat sheet

XPath or XML Path Language is a query language for selecting nodes from an XML document. Also, people used it to compute values from the content of an XML document.

When using Selenium to automate tests, and there are no ID or Name that we can use to find an element on the page, XPath can help. XPath can find the location of any element on a web page even those without class, name, or id attributes. Most importantly, it produces reliable locators if used correctly, but at the same time, It is the most complicated method of identifying elements.

My XPath locators for Selenium course is a Bestseller course in the Selenium Testing Framework category. You can learn how to build complex XPath locators for Selenium automation that will work on any web element. However, it’s easy to forget all the formulas, syntax, and techniques that you can learn in that course.

That’s why I created an XPath cheat sheet. It’s easy to download and print on a piece of paper, to use every time you need to build a cool XPath locator. This cheat sheet contains everything you learned in that course. There are two versions of the cheat sheet, so you can download and choose the one you like better.

Below are the links to download XPath cheat sheet.