Web application testing tools

Automation of basic tasks is important – work smart and efficient. I am trying out Watir (pronounced water) for web application testing. Watir stands for "web application testing in Ruby". Watir was recommended to me by two other sr. technologists (thanks Anjali and Nikhil).

Why do I think it is the killerest? Watir is a test framework written in Ruby. The test scripts are also required to be written in Ruby. The idea is to instantiate an instance of Internet Explorer at the start of your script. The test script is given a handle to the browser. A programmer can then use the handle to script in input to the browser and validate and verify the output. Under the hood, this is accomplished by directly manipulating Internet Explorer using DOM. This is similar to how javascript manipulates the DOM through IE.

The advantages are many. I wrote my first (dead simple) script within 15 to 30 minutes. This way, I can also avoid any harness-specific issues. I also avoid the "recording" phase. My tests scripts are already parameterizable, since they are written in a programming language.

What does it lack? Anyone heard of firefox and linux? I cannot run Watir of a Linux/POSIX box as it stands today. I am already thinking of extending Ruby to provide handles for SOAP, LDAP and other application protocols. I am not sure how easy or hard that would be.

To what can I compare it? I tried to first pick up on Apache JMeter. I ran into two problems. Firstly, a lack of simplified documentation to get me started with writing a simple test script. Have a look at the first page of "Building a test plan" in the JMeter user manual. The second is subjective – I felt the interface to compose a test "story" (If I may call it that) was not intuitive. Nevertheless, people who do know JMeter will swear by it for automation of functional as well as performance testing.

My research is far from complete. Yet, I will bet my money on writing scripts in a language rather than through a point and click user interface. Power over usability. This also implies that I will have to first gain expertise in Ruby to get anywhere near exploiting Watir to the hilt. Later, I could try and peek into JMeter's internals to see if scripts can be written in the native language with little learning other than knowledge of Java.

References:

Update: Also have a look at the Selenium IDE. Selenium is similar to Watir but automates the process of script creation through point and click. So the choice of power or usability is really up to you. An advantage is, Selenium will work on Linux/POSIX and Mac OSX. Selenium is built and supported by Thoughtworks.

Advertisements

One Comment on “Web application testing tools”

  1. ROhan Kini says:

    You should check out Sahi (http://sahi.sourceforge.net/)

    Another Cool testing tool from ThoughtWorks.