File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Better JavaScript support than HtmlUnit?

 
Scott H Ferguson
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been developing some in-house WebApp testing tools using HtmlUnit. In a couple of cases I was able to tweek the HtmlUnit source code to support the odd bit of JavaScript that is not currently supported in version 1.7.

As the pace of development of out webapp has increased I am starting to run into more instances where javascript is not supported (ie, javascript urls). I am afraid that I can not keep up and that the HtmlUnit will not have a fully compliant product in the near future.

Are there any free or commercially available packages that work by emulating the browser, like HtmlUnit, but FULLY implement javascript functionality?
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm afraid all three main tools (HtmlUnit, HttpUnit, jWebUnit) use the same Rhino JavaScript engine for JavaScript support. What you could try is a tool that uses the real browser, such as Watir (Ruby/Windows), Pamie (Python/Windows), or Selenium (multi-language, multi-platform, but possibly a bit tricky to set up and integrate into your development environment).
 
Manish Hatwalne
Ranch Hand
Posts: 2591
Android Firefox Browser Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, even I have faced this problem while testing my Ajax stuff with HtmlUnit/HTTPUnit. Any workaround for that?

- Manish
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One possible partial work-around is to separate the testing of the fundamental request/response data versus testing the rendered result itself. For example, if you are using Struts then MockStrutsTestCase can be used to see if the data about to be send to the JSP page and the selected forwarding is what you expect. That tells you if everything prior to the final rendering is at least correct.

For Javascript-specific testing, there are I think three derivations of JUnit out there, but really they are only helpful for letting you test a Javascript library, not so much a specific page. I haven't seen anything that combined HttpUnit-like testing of the rendered result with Javascript either.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic