Wednesday, 10 June 2009

Watij: Brief progress report

I have been evaluating Watij lately and here are my conclusions so far for some automation features important to me:

IDE

Since I am from the QTP/VBScript world I still struggle a bit with the Java syntax and OO...furtunatly my IDE (IntelliJ IDEA) has very good refactoring features (and other develop-friendly features as well) so it is not necessary to make perfect code/structure from the start.

GUI test execution speed

Not as fast as QTP but very close. Since the source code is available I managed to change a hard-coded timeout property and I guess there are several others that you could tweek for faster performance.

Test object model

Quite simular to Descriptive programing in QTP.

QTP example: Browser("Google").Page("Google").WebEdit("q").Set "Watij"
Watij example: ie.textField(name,"q").set("Watij");

Have not explored all possibilities with dynamic test object handling in Watij yet but at least getting all links in a frame into an array was very simple.

Community

The QTP community is awesome and Watij's dito seems ok but rather small.

Pop-up handling

QTP is very good handling pop-ups but have a weakness running such actions in a locked workstation. Watij has so far also been very good at this (except for an authentication dialog which I handled with a quick and dirty java robot solution) and IT WORKS IN LOCKED MODE! This feature alone allows unattended GUI tests being run 24x7...This seems to good to be true so I will do some more testing on this using remote desktop -> server...

6 comments:

Glenn Halstead said...

This is very interesting Stefan, coming form the QTP to an Open Source alternative. I'm a QTP man who's just moved to Fitnium, a combination of Fitnesse and Selenium RC. It's great to hear your perspective from a QTP background.

Stefan Thelenius said...

Using Open Source/Free tools will most likely scale very well if succesfully implemented...

How is pop-up handling in Fitnium?

Regards

/Stefan

Keith Sterling said...

Hi Guys

Fitnium handles popups exactly like Selenium, given that its just a wrapper/bridge around Selenium

In both popups are not displayed, instead Selenium ( and therefore Fitnium ) provides capabilities to detect when a popup occurred and what to do when it does.

If you have copy of Fitnium, then check out the JavascriptDialogsApis. Here you will see the basic construct

There are 3 basic popups in Web, Alert, Confirmation and Prompt. For each of these you can check if it occured ( not displayed, just Selenium stating it would have displayed a popup ).

Then for confirmation you can control how the user would respond with either yes, no cancel

And for prompt and confirmation you can test what message was displayed

Hope this helps

BTW, Moving Fitnium to Sourceforge soon, the account is there and therefore so are the Support forums for you to use

Keith
Author of Fitnium

Stefan Thelenius said...

Thanks for the info!

Regards

/Stefan

Amit said...

Hi,

I'm currently using Watij library and creating JUnit test cases for my UI automation.
But I'm stuck at automating HTTP Authentication.
You mentioned "except for an authentication dialog which I handled with a quick and dirty java robot solution"

Please explain how you could overcome the issue.

Stefan Thelenius said...

Hi,

Sorry for late reply, check out robot class in Java...

Robot robot = new Robot();
robot.delay(2000);
robot.mouseMove(693, 624);
robot.delay(1000);
robot.mousePress(InputEvent.BUTTON1_MASK);
robot.mouseRelease(InputEvent.BUTTON1_MASK);
robot.delay(1000);

Not a solution I can recommend...