Note: Published an update here.
I have been looking out for some good open open source automated functional testing tools. After some bit of research and based on some recommendations I went on to try Watij and Selenium.
Watij:
Based on popular ruby based Watir, I was quite impressed by its API. It has got good little documentation on its site and on wiki, just enough for you get started and do some reasonable testing. You can write the tests using the popular JUnit framework, which is a big plus.
It all worked fine, in fact, I could automate quite a few screens in an application until I hit a roadblock
Whenever it encounters modal dialog windows it just stops working. Some how it seems not recognize them, and waits for the screen to load even though it has already been loaded.
Wondering how other people working with Watij working around this limitation. It has been a while since they made a release after 3.1.0. I hope the support for modal dialog windows would be functional in the next release.
Selenium:
After that experience with Watij, I started looking at Selenium. For some reason, I did not have that much luck, not even as much compared with Watij.
After starting up the Selenium server and try to hit a web page I’ve received a 404 error on page. Based on the documentation on the site, I have started using *iehta instead of *iexplore and the 404 went away. The joy was short lived as I started getting windows dialog messages saying a “script is trying to run, do you want run it?” (not the exact verbage). I had to keep clicking Yes on it to move forward.
However, with bit more researching I found a way to resolve that. This time started the server in the mutiwindow mode (with -multiWindow option) the application started running on a different window than that of the Selenium browser.
That is as far as I can go with this at this point. As I start with a page on the application I see dozens of browser windows started popping for the same page. Each of this page shows up a confirmation popup saying that the web site you’re on is trying to close the window, do you want to close the window? Not sure why Selenium wants to close the browser as soon as it opens this very first page! This was working some time ago when I was on IE 6, now that I’m on IE 7 I find this issue.
Conclusion:
All in all, I found more success with Watij than Selenium (on IE 7). I’m sure there are many people out there using both these APIs. I see there are many open source projects using Selenium. I’d be interested in knowing what they think about these two APIs. Which one they liked better and why? Are they ready for prime usage?
You may also like:
Follow on Twitter
#1 by Jônatas Cabral on March 15th, 2008
Quote
hello, do you have any example of tools aplication?
[Reply]
#2 by David Beaton on April 16th, 2008
Quote
I’m looking at them both too, and one big difference is that Watij only works with Windows running IE. That’s a problem from me as I normally use a Mac and Firefox.
[Reply]
#3 by sres on December 17th, 2008
Quote
can anybody suggest how to see reports or results in watij tool
[Reply]
#4 by Raghuram Suravarapu on March 9th, 2009
Quote
Hi Surya,
Please suggest me which is the best testing tool. I am looking for an Open Source/Cheapest automation tool which works on both Client-Server and Desktop environment. Also i have gone through both tools WATIJ and Selenium which works for Web Applications.
-Raghuram
[Reply]
Surya Suravarapu Reply:
March 9th, 2009 at 11:06 am
Best is a relative term, depends on what your requirements are. My more recent observations on this topic are posted here. For web app testing — popular open source options are Selenium, Watij (Watir) and Web Driver. For desktop applications I haven’t found a good open source tool yet. But my research was very much limited in this area as my focus was on web apps.
[Reply]
#5 by genelia on October 29th, 2009
Quote
Hi,
Can any one send me the Watij code written in javascript.The code like where you enter the name in a text field.
genelia
[Reply]