With the release of Selenium 2, I decided to embark down the path of adding UI unit tests to savory so that I can eventually put the kibosh on emails from my boss about how so-and-so feature of the UI is broken for some reason.

The problem is that Selenium 2, in particular WebDriver, is just far too immature to be of any use. The drivers are missing protocol support, the libraries are missing driver support. In general it’s a clusterfuck right now, but I expect it to get better with time.

For my UI’s purposes, the only driver that appears to work “enough” right now is HtmlUnit with Js support. I say “enough” because even it is broken insofar as it inexplicably times out every now and then.

So with my new Selenium stuff in hand, I proceeded to find examples of Python bindings examples. Good luck with that.

All the Selenium docs are written with Java in mind. The Python documentation on pypi even goes so far as to say “read the source, Luke”. This is to be expected though, because everyone knows that “open source documentation” is an oxymoron. Surely there must be some examples on the Internet somewhere though right?

Well, no, there aren’t. At least not examples that refer to Selenium WebDriver functionality. All the search results are still stuck on version 1.x of Selenium. Lame.

Being that there is dick for reference material on the net, I’m going to be elaborating through a series of wiki pages how I’ve gone about setting up Selenium and using HtmlUnitWithJs, Python Bindings, the PageObject design pattern, and the Python unittest module with a suite of tests to give savory its UI unit tests.