Paul Hammant's Blog: Selenium: kick ass web testing for free
In the fall of last year, Jason Huggins showed many of us ThoughtWorkers “JavaScript Functional Test Runner”. His team (Paul Gross and Jie ‘Tina’ Wang) developed it inside TW to test the new Time and Expenses (T&E) application. It ran entirely inside a browser (you can see it working here in modern incarnation). It’s cross browser, cross platform and is very good at testing web applications.
Though almost perfect for many, I felt it needed to be driven from outside of the browser. From a regular language as well as in a tabular form (CSV). This would enable a few things - integration with unit test frameworks, running from CruiseControl or DamageControl, deterministic behaviour, testing dirty tricks (mid test delete of a row to see how the webapp recovers). Anyway, I first introduced Bret Pettichord and Jason to each other and convinced them to combine forces behind the effort. A couple of days later Ryan Wilcox was on the team and interest was assured.
The limitations of the browser were clear* - it could not open a socket and listen on it for instruction from the driver, so result/command polling design rather than command/result was the obvious workaround. It meant for more clunky driver implementations (blocking queues are needed), but these were still fairly easy to port. Porting was necessary because developers are very partisan when it comes to languages - even for testing. The interest in ThoughtWorks was quickly generated, with Aslak , Darrel Deboer and Mike Melia concentrating on refactoring the JavaScript (common code between the in-browser and driven modes of operation). Tangential tasks included the writing the first Selenese Java driver (me), evolving the Selenese wire language (many of us), porting the rudimentary Java driver to Ruby (Damien, Bret Pettichord), to C# (Premanand C, Mike Williams, Kurmin Karabukaev, Mike ‘Pip’ Roberts ), to Python (Jason again), and finally giving the Java version wider web server compatibility (Ben Griffiths, Andy Duncan). Now the team is too large to list, and we have friends of ThoughtWorks helping out as we go thru the alpha versions to beta. Maybe the industry can finally have an alternative to WinRunner which is difficult to make run in an Agile/best practice way.
Selenium is Apache 2.0 licensed. As it principally uses theDOMinside the browser(s) for poking theAUT, and that being a standard, it is perfectly good for testing any licensed web app (including GPL). Indeed, one written in any language.
We have big plans for Selenium. People should come and help out if it strikes a chord. The site - http://selenium.thoughtworks.com/
- I wrote an Insurance Quote applet in 97 that could open a different socket back to the server it was essentially hosted from. That was closed when the same origin policy came into years later. That was news to me at least.