Digging for XPath Treasure using Chrome

http://www.actionrecon.com/2010/10/professor-longhair-big-chief-show-off-their-parkour-skills/ I was never a fan of using XPath in my cucumber step definitions… mostly because I didn’t really understand how it worked.

Recently I had the chance to work with some people that use XPath way more than I do and I extracted this nugget of info from them. (Thanks John!)

You can use $x in the Chrome javascript console. No extensions needed.

$x("//img")

I’ve seen a few questions on StackOverflow about this and all the answers related to installing a chrome extension. I thought it was definitely worth writing down.