aspose file tools*
The moose likes Testing and the fly likes Watij or HttpUnit? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Watij or HttpUnit?" Watch "Watij or HttpUnit?" New topic
Author

Watij or HttpUnit?

Unnsse Khan
Ranch Hand

Joined: Nov 12, 2001
Posts: 511
Has anyone used Watij or HttpUnit?

Would appreciate any feedback regarding these frameworks!

Sincerely,
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30957
    
158

Unnsse,
I've used Selenium which is the same idea as Watij in that it runs in a browser. (It uses a different browser - Firefox.) I like front end testing frameworks that run in the browser as that is where the "real" app runs.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Unnsse Khan
Ranch Hand

Joined: Nov 12, 2001
Posts: 511
Jeanne,

Thanks for the response!

It is more "mature" than Watij?

Do you have a URL for it?

Is it this one:

http://www.openqa.org/selenium/

Seems like a QA tool instead of a unit testing tool?

Happy programming,

Unnsse
[ March 13, 2007: Message edited by: Unnsse Khan ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42635
    
  65
Selenium is impressive (definitely check it out), but it does operate on a different level than HttpUnit. HttpUnit (and other, similar libraries like HtmlUnit and jWebUnit) are faster to set up and get going with, but they don't include tools that can create test code by watching a browser.


Ping & DNS - my free Android networking tools app
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Unnsse Khan:
[Selenium] is more "mature" than Watij?

Selenium has been around for longer than Watij. I also believe that Selenium is more widely in use.

Originally posted by Unnsse Khan:
Is it this one:
http://www.openqa.org/selenium/

Yes, that's the one.

Originally posted by Unnsse Khan:
Seems like a QA tool instead of a unit testing tool?

Note that none of the tools mentioned in this thread are unit testing tools. HttpUnit, Watij, Selenium, they're all functional testing tools for web applications.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Unnsse Khan
Ranch Hand

Joined: Nov 12, 2001
Posts: 511
Originally posted by Lasse Koskela:

Note that none of the tools mentioned in this thread are unit testing tools. HttpUnit, Watij, Selenium, they're all functional testing tools for web applications.


Thanks for the clarification! Yes, these type of tools is what I am looking for... More specifically, I am looking for something which supports the AJAX (XMLHttpRequest) object.

I use a 3rd party UI framework (AJAX implementation) and most of the acceptance / functional testing frameworks are not AJAX compliant.

Sincerely yours,
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30957
    
158

Unnsse,
Selenium and Watij are both playback/record tools. Which means they support anything the browser can do.

You are correct that they are less "programmer" tools than HttpUnit, but that just means you are working at a higher level. Selenium provides hooks if you really want to write code. I find the playback/record mode easiest to use though.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Jeanne Boyarsky:
Selenium and Watij are both playback/record tools. Which means they support anything the browser can do.

Actually, Watij is not a record/playback tool (or capture/replay or record/replay, whatever you want to call it). With Watij, just like with Selenium's "RC mode", you write tests by writing code and the code drives an actual browser instance. In the case of Watij, this is implemented by the Java code talking to the InternetExplorer COM object. In the case of Selenium, it's a bit more complex and involves the browser constantly downloading "commands" from an intermediary server.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30957
    
158

Thank you for correcting me Lasse. Clearly I didn't look at the Watij website in enough detail!
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
In particular, watij is effectively a java clone of the ruby-based tool watir (one reason why the name of the original one sounds so much better)

One good way to find out what watij is all about is actually to read about watir.

And, of course, don't forget to add the original watir to your scriptable functional testing tools shortlist. Our test guys love watir, and have taken to scripting tests (and automating data loads, etc.) with it like ducks to, err, watir


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Unnsse Khan
Ranch Hand

Joined: Nov 12, 2001
Posts: 511
Thanks for all the great feedback, everyone!

In regards to Fitnesse, Selenium, Watij, HttpUnit, etc. - what I am seeking is a way to run one of these as a Ant target. Is this possible?

So, far Selenium RC (RemoteControl) seems to be the best one for my needs...

Sincerely yours,
Naveen Sharma
Ranch Hand

Joined: Mar 23, 2001
Posts: 65
Consideration to be taken care of, while using Watij :

1. Runs for IE till now, and NOT for any other browser.
2. Runs on Windows environment only
3. A JUNIT Wrapper over watij script may be a good way of execution. instead of beanshell.
4. Finally all can be automated in ANT build.

HTH
Naveen
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Unnsse Khan:
In regards to Fitnesse, Selenium, Watij, HttpUnit, etc. - what I am seeking is a way to run one of these as a Ant target. Is this possible?

Of the above tools I've run Fit (not Fitnesse), Selenium and HttpUnit through Ant. For Fit, I basically used the <exec/> task and for Selenium and HttpUnit I used the <junit/> task (driving Selenium and HttpUnit from JUnit tests).
 
Consider Paul's rocket mass heater.
 
subject: Watij or HttpUnit?