More than an year ago I published my experiences with Selenium and Watij. At that time I was actually not sure whether Selenium and Watij were ready for prime usage, especially for testing on IE7 (a requirement for my app). So fast forward to now, I’m lot more satisfied with what I’m seeing ..
Both the tools have got more recent versions out compared to what I used earlier. Started to work on Selenium RC. I was glad a lot of stuff that was a bit shaky in my earlier experience is more polished now. Just when I was thinking that I’m proceeding quite well with Selenium RC, hit with an issue where Selenium loses handle to the main window if the (child) popup window posts data and the main window refreshes based on that post. Logged a critical issue at Selenium’s Jira, still awaiting for some action on that (I wish I had some time to look into that and provide a patch, if required).
After that, started to look for alternatives — having used Watij earlier, prompted me to give it another try. I was pleasantly surprised by the ease at which I could proceed this time, including the issues that I was having earlier with modal dialogs. Here are some of the comparisons:
- Watij’s API is more Object-oriented than that of Selenium’s, which is perhaps more functional in nature.
- While using Selenium I had to use waitForXXX calls to wait till the page gets loaded, or for the popup to get loaded, etc. But with Watij the tool is “smart” enough to figure when the page load completed so as to proceed with the subsequent calls. Having said that there are still some areas where some sort of wait is required, but I believe that is based on the application functionality that is under test.
- Selenium injects Javascript into the pages of application under test. It also requires Selenium server running (only proxyInjection mode worked for me). Watij on the other hand doesn’t need a server. It requires a dll (yikes!, but that’s not that bad) to be placed in your System32 folder of Windows. I found Watij to be a bit more robust and found that behavior was consistent when compared with Selenium.
- A drawback for Watij is it works only for IE. That works fine for me as that is our primary requirement. If you have to test under different browsers than Selenium is perhaps the way to go.
- With Selenium IDE, the tests can be recorded using a Firefox plugin. There is no such recording capability with Watij.
- Watij doesn’t have a Selenese type of “language” to write the test cases outside of using a programming language (like Java). Needless to say that this kind of notation would be useful for non-technical people. Having said that it is not that difficult to write your own version of Selenese kind of notation.
With all those observations, Watij was what I chose to proceed with. Combination of the robustness of Watij and the critical issue that I was hit with while using Selenium (described above) made me to move in the direction of Watij.
You may also like:
Follow on Twitter
#1 by Jason Yip on December 29th, 2008
Quote
Hi Surya,
I still like the Watij API. The last I looked they were looking at Firefox support but I don’t know how far that has got. Watir and FireWatir have supposedly merged so that is another option. Watij is somewhat faster but the constraint might not be your test driving tool. Another tool you may want to look at is WebDriver.
[Reply]
#2 by Surya Suravarapu on December 30th, 2008
Quote
Jason, WebDriver is the next thing that I will be looking into. I’ve heard some good reviews about it on Twitter.
[Reply]
Pingback: Watij and Selenium: Are they ready for prime usage? - Surya Suravarapu’s Blog
#3 by Prabhu on September 4th, 2009
Quote
I’m facing IE hanging issue and inconsistency when run web driver scripts in IE. If any one have come across these issues & found workaround. please provide the solution.
[Reply]