This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Testing and the fly likes Which Functional Test Tool Has best Javascript Support Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Which Functional Test Tool Has best Javascript Support" Watch "Which Functional Test Tool Has best Javascript Support" New topic
Author

Which Functional Test Tool Has best Javascript Support

Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
Among HttpUnit, JwebUnit and HtmlUnit which one has best support for Javascript?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29220
    
135

None of the above.

JWebUnit is based on HttpUnit. I haven't used HtmlUnit, but the documentation provides says it provides partial support for JavaScript.

The essence of the problem is that these tools are simulating the browser. And since browsers all implement javascript differently, you aren't really testing how the code will behave. To truly test JavaScript, you can use a tool that runs in a browser like JSUnit or Selenium.


[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
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
All of these three happen to be using the same JavaScript engine internally (Mozilla Rhino) so there shouldn't be that much of a difference between them. Having said that, I'd personally recommend HtmlUnit or JWebUnit over HttpUnit because the development for the latter seems to have halted and HtmlUnit (which JWebUnit uses internally) uses the Jakarta Commons HttpClient instead of a homegrown solution for handling HTTP (and HTTPS) connections, making it a lot more robust than HttpUnit.


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

Joined: Jan 28, 2004
Posts: 569
There are books describing HttpUnit, but I can't find any for HtmlUnit. Personally, I'd prefer sticking to one with better documentation available.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Which Functional Test Tool Has best Javascript Support
 
Similar Threads
Validator Framework Vs JavaScript
more than one click on a button
URGENT---- running javasscript on server side
What IDE or tools do you recommend (or use) for jQuery programming?
Free, good IDE