April 10, 2008

Latest Cool Tool

I’m sure everyone else in the world found and mastered  XPath Checker long ago, but for those of you who haven’t, it is a fantastic Add-on for Firefox that lets you practice XPath expressions on real, live web pages.

Why would you want to do that? 

If you want to write Functional webapp tests via Selenium, a good, solid working knowledge of XPath is essentially mandatory for all but the most trivial of tests.

What about Selenium IDE? 

The Selenium IDE is incredibly helpful for navigating your pages, but it is not help at all with testing the content on those pages.

In other words, if you want to register a new user, add four things to your cart, visit your recommendations page and then check out, Selenium IDE will properly structure your clicks and everything else.

But if you want to find out if your checkout page lists your four items, and you need to be specific about where on the page  those items show up, you have to use XPath with Selenium to get to the correct table, div, what-have-you.

Enter XPath Checker.  During your Selenium IDE-driven  recording session, control-click on the page, and experiment with the correct XPath query to get to the cell/row/etc you want to see.