I always love a good cheat sheet hanging on my corkboard when I’m working, and XPath is one of the fields where I often refer to it. If you’re looking for a good XPath cheat sheet you will probably find something useful in this post.
1. XPath, CSS, DOM, Selenium Locators
This is a nice wallchart from Rosetta Stone and Cookbook that covers such popular technologies as XPath, CSS and DOM in the sense of locator syntax. There are two charts here. The first one is organized like an XPath Cookbook with plenty of recipes:
and the other one is more like an XPath Reference Book with all the locators organized by their categories:
2. XPath 1.0 Quick Reference
This quick reference from deepX contains information about XPath Axes and Functions. It takes two full sheets and offers short descriptions for every element with references to W3C recommendation paragraphs:
3. XPath 2.0 Quick Reference
This is the only XPath 2.0 Cheat Sheet from D Vint Productions in this post. Like a previous chart it is also quite scientific, having strict definitions and W3C references:
4. XSLT 1.0 & XPath 1.0 Quick Reference
This XSLT and XPath Quick Reference from Mulberry Technologies is supposed to be printed on both sides of the page and be folded four times. It gives a short list of functions, operators, node and object types and other elements of XPath and XSLT. Unlike the deepX’s chart, it gives just short clues without any descriptions (but with a bigger font):
5. XPather Cheatsheet
The last cheat sheet, which is from Viktor Zigo, is not in PDF format, but I really like its simplicity. So, if you’re okay with an online cheat sheet, you can visit http://xpath.alephzarro.com/content/cheatsheet.html.
3 replies on “5 Best XPath Cheat Sheets and Quick References”
How can I get a response code using xpath or regex?
Explain more, what kind of response code? Where?
Thanks a lot.