• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Better JavaScript support than HtmlUnit?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic