Watir (Web Application Testing in Ruby)

Watir

Licence

OpenSource

How it works

Watir uses Ruby, object oriented scripting language, to drive the Internet Explorer web browser.
In fact, Watir is a Ruby library that wraps the COM interface to Internet Explorer. Like most languages, Ruby can access COM interfaces. The COM interface to IE allows access to the browser's document object model (DOM).
It works with pure html, and in limited way with JavaScript and AJAX
It will not work with ActiveX plugin components, Java Applets, Macromedia Flash, or other plugin applications

Pros:

Cons:

...There has been some experimental code packaged with Watir to deal with popups with limited success. A good popup handling solution is being worked on and will be included in a future Watir release...

Sample code

Has been checked into SVN: https://svn.codehaus.org/xplanner/trunk/spikes/watirExample. The suite contains two tests. The first one is simple XPlanner project creation, the second test shows interaction with an AJAX page

Selenium

Selenuim

Licence

Apache 2.0 license

How it works

Selenium tests run directly in a browser, just as real users do. Installed with your application webserver, Selenium automatically deploys its JavaScript automation engine the Browser Bot to your browser when you point it at the Selenium install point on your webserver. Selenium uses JavaScript and Iframes to embed a test automation engine in your browser. Because different browsers handle JavaScript somewhat differently, they usually have to tweak the engine to support a wide range of browsers on Windows, Mac OS X and Linux. Tests can take one of two forms. They can be embedded in an HTML table, which will be read in by the browser bot and then executed. You can also use programming language, taking advantage of language-specific drivers that communicate in Selenese (Selenium command language) to the browser bot. So far Java and Ruby drivers have been released.

Pros:

Cons:

Sum up:

To sum up Selenium-driven for Java developers seems not to be stable and ready for functional test using yet.

Sample code

Please see the implemented code in https://svn.codehaus.org/xplanner/trunk/spikes/seleniumExample. The XplannerSimpleTest.java class defines Selenium-driven setup and two tests for creating and deleting a simple Xplanner project. The OutbeddedTomcat.java class was refactored but the previous version was stored as OutbeddedTomcatOld.java.

Interesting articles

Using Selenuim to test AJAX calls
Selenium driven by java movie
Watir and Selenium, Bret Pettichord's blog, February 2005