News: HtmlUnit 1.12 Released

  1. HtmlUnit 1.12 Released (5 messages)

    HtmlUnit is a cross-platform 100% Java headless browser intended for use in testing web-based applications in conjunction with unit testing frameworks such as JUnit or TestNG. HtmlUnit allows you to interact with your web application at a high level via an API which enables you to invoke pages, fill out forms, click links, etc. HtmlUnit also contains an advanced implementation of the JavaScript DOM objects, including IE-only features for those who need them. The latest version of this popular testing tool contains a number of performance improvements, tons of bug fixes, and many new features, including a deterministic AJAX controller, enhanced support for the Prototype JavaScript library, support for script.aculo.us drag and drop, and full support for the jQuery JavaScript library. More details can be found in the change log. For information on getting started, see this page. The source code and binary packages may be downloaded here. For those who like to live on the edge, the latest snapshot builds are always available here. Enjoy!

    Threaded Messages (5)

  2. Re: HtmlUnit 1.12 Released[ Go to top ]

    HtmlUnit is too cumbersome to use. Selenium tests are more readable and easier to write.
  3. Re: HtmlUnit 1.12 Released[ Go to top ]

    If for instance reliability, speed, detection of js errors, real XPath support, extensibility, etc. matters for you, then you should perhaps have a look. Otherwise I agree that for normal functional test scenario HtmlUnit API may be to low level, but in this case you should forget Selenium and use Canoo WebTest (http://webtest.canoo.com, which itself uses HtmlUnit).
  4. The idea of unit test is that it either drives the code (Test Driven Development) or proof its correctness (General Practice) In case of html unit test and the frameworks to do it does not help in any of this two approach. The first approach is no way applicable to html as the unit test for html are moreover parsing of html DOM and putting assertion on its output. Is it not overkill to drive your html code based on html unit test? If lets say you use html unit test for second reason then writing html unit test is more erroneous then html code. Is this poor unit test capable of giving code confidence? Thanks, Shabbir
  5. I'm not using TDD: my tests are written (very shortly) after the code is written. And it's true that my HtmlUnit tests don't help me find bugs immedialtely very often. But they are extremely helpful because they provide regression tests. When you start refactoring your code, changing property names in your beans (accessed using EL in the JSPs, which are not refactored), changing URLs in your webapp, etc., running the HtmlUnit test suite helps finding broken links, broken sections, etc. just after a code change. And when you work with less experienced developers, who don't estimate the impact of their code changes correctly, HtmlUnit is a real help. I've also realized that using HtmlUnit forces developers to care more about the simplicity and correctness of their HTML code. I'm very glad HtmlUnit 1.12 is out, because I was waiting for better Ajax and Prototype support since 1.10, and I hope this release will help us cover the areas we weren't able to test yet. JB.
  6. The idea of unit test is that it either drives the code (Test Driven Development) or proof [sic] its correctness (General Practice).
    If you're using HtmlUnit or any of the other available web app test tools, you're probably not unit testing, technically. You're more likely integration testing, or functional testing, or regression testing. Of course, if you don't see any value in these sorts of tests, then HtmlUnit is probably not your kind of tool. It's sort of like a last level of automated defense, just to make sure all the pieces fit together as intended before sending the application to the next stage in the delivery process. Take care, Daniel