File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30919
    
158

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