667481 members! Sign up to stay informed.

Sponsored Links


Resources

Enterprise Java
Research Library

Get Java white papers, product information, case studies and webcasts

News News News Messages: 5 Messages: 5 Messages: 5 Printer friendly Printer friendly Printer friendly Post reply Post reply Post reply XML XML XML

HtmlUnit 1.12 Released

Posted by: Daniel Gredler on August 14, 2007 DIGG
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 replies

·  HtmlUnit 1.12 Released by Daniel Gredler on Tue Aug 14 05:55:08 EDT 2007
  ·  Re: HtmlUnit 1.12 Released by zqu dlyba on Tue Aug 14 19:11:10 EDT 2007
    ·  Re: HtmlUnit 1.12 Released by Marc Guillemot on Fri Aug 17 04:48:32 EDT 2007
  ·  What is the point in test HTML? by Shabbir Hussain on Wed Aug 15 00:11:42 EDT 2007
    ·  Re: What is the point in test HTML? by Jean-Baptiste Nizet on Wed Aug 15 05:32:59 EDT 2007
    ·  Re: What is the point in test HTML? by Daniel Gredler on Wed Aug 15 12:26:18 EDT 2007
  Message #238031 Post reply Post reply Post reply Go to top Go to top Go to top

Re: HtmlUnit 1.12 Released

Posted by: zqu dlyba on August 14, 2007 in response to Message #237883
HtmlUnit is too cumbersome to use.

Selenium tests are more readable and easier to write.

  Message #238037 Post reply Post reply Post reply Go to top Go to top Go to top

What is the point in test HTML?

Posted by: Shabbir Hussain on August 15, 2007 in response to Message #237883
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

  Message #238049 Post reply Post reply Post reply Go to top Go to top Go to top

Re: What is the point in test HTML?

Posted by: Jean-Baptiste Nizet on August 15, 2007 in response to Message #238037
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.

  Message #238066 Post reply Post reply Post reply Go to top Go to top Go to top

Re: What is the point in test HTML?

Posted by: Daniel Gredler on August 15, 2007 in response to Message #238037
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

  Message #238219 Post reply Post reply Post reply Go to top Go to top Go to top

Re: HtmlUnit 1.12 Released

Posted by: Marc Guillemot on August 17, 2007 in response to Message #238031
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).

New content on TheServerSide.comNew content on TheServerSide.comNew content on TheServerSide.com

Dependency Injection in Java EE 6 - Part 1

Reza Rahman explores the features of the proposed JSR 299, Contexts and Dependency Injection for Java EE (CDI). When approved, it promises to be a key feature of Java EE 6. (November 2, Article)

SAML: It's Not just for Web services

SAML is an XML-based standard for exchanging authentication and authorization data between security domains. The single most important problem that SAML was created to solve is the Web browser Single Sign-On problem. Many organizations are debating whether to stay with version 1.1 or move to 2.0. This article makes observations about both options. (September 28, Article)

Programming is Also Teaching Your Team

Joe Ottinger takes a look at how people learn, and applies it to the practice of programming. He notes that understanding how people learn is an essential part of working in a programming team. (September 22, Article)

Can Java EE Deliver The Asynchronous Web?

Stephen Maryka gave us an article about the Asynchronous Web and posed a number of questions that get examined like an approach to delivering Asynchronous Web capabilities through extensions to existing Java EE technologies. (July 14, Article)

JSF Flex

JavaServer Faces Flex goal is to provide users capability in creating standard Flex components, part of flexSDK which is open sourced through MPL license, as normal JSF components. This article by Ji Hoon Kim will provide an overview of creating a simple multilingual JSF page consisting of JSF Flex tags. (June 29, Article)

The Rules of SOA - A Road to a Successful SOA Implementation

In this session Jeff explores the key characteristics of successful SOA projects. He covers some of the patterns, and anti-patterns, tool sets, and strategies that he himself learned the hard way. Last, he provides a strategy and blueprint for achieving a high likelihood of success in your SOA project. (June 23, Tech Talk)

Ari Zilka Talks About Terracotta 3.1

Ari Zilka, CTO of Terracotta, Inc., talks about the new features in Terracotta 3.1, announced during JavaOne and available now. (June 15, Tech Talk)

Enterprise Application Integration, and Spring

In this Tech Talk, Josh Long explores an integration challenge using Spring Integration and walks through the implementation, employing and expanding on the basic patterns of Enterprise Application Integration to tie together components into a function integration solution, and then demonstrates how Spring Integration helps address the integration requirements. (June 15, Tech Talk)

Google Web Toolkit: An Introduction

In this Tech Talk, David Geary teaches you: The basics of Google Web Toolkit; How to implement Ajax-enabled applications in Java; Internationalization; Hooking into the browser history mechanism; Remote procedure calls. (June 4, Tech Talk)

Just Enough Early Architecture to Guide Development

Jon Kern discusses the best architecture/technical solutions and ensure that they are repeated by all developers. By tackling the architecture up-front in a serial manner, subsequent parallel development will be much more manageable and predictable. (May 28, Tech Talk)

Productive Programmer: On the Lam from the Furniture Police

This keynote describes the frustrations of modern knowledge workers in their quest to actually get some work done, and solutions for how to guard yourself against all those distractions. Neal Ford talks about environments, coding, acceleration, automation, and avoiding repetition as ways to defeat the misguided attempts to sap your ability to produce good work. (May 26, Tech Talk)

Auto-Scaling Your Existing Web Application

Gil demonstrates how new, aggressive uses of already abundant compute capacity by common applications offer competitive value for application designers. (May 21, Tech Talk)

Automating Hibernate Mapping and Queries For Java Web Development

Chris Keene introduces WaveMaker as a new way to automate the ability to generate Hibernate classes in order to more quickly bring OR mapping into an application. (May 19, Article)

Auto-Scaling Your Existing Web Application

In this session Nati Shalom demonstrates how to take a standard Java EE web application and scale it out or down dynamically without changes to the application code. Seeing as most web applications are over-provisioned to meet infrequent peak loads, this is a dramatic change because it enables growing your application as needed, when needed, without paying for unutilized resources. (May 19, Tech Talk)

Free Book: Jakarta-Struts Live

Download the entire book of Jakarta-Struts Live and learn about Struts MVC, Tiles, the Validator, DynaActionForms, plug-ins, internationalization, and more.
(Book PDF Download)

Application Server Matrix

The Application Server Matrix is a detailed listing of J2EE vendors and their application server products, with information on latest version numbers, J2EE spec support and licensing, pricing, platform support, and links to product downloads and reviews.
(Application Server Comparison Matrix)

News | Blogs | Discussions | Tech talks | Patterns | Reviews | White Papers | Downloads | Articles | Media kit | About
Java Solutions
All Content Copyright ©2007 TheServerSide Privacy Policy
Site Map