JWebUnit Installation

Using Maven

If your project use Maven, it's very simple. Just add the plugin you want as dependency:

<?xml version="1.0" encoding="UTF-8"?>
<project>
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.compagny.myproject</groupId>
    <artifactId>myproject</artifactId>
    <version>0.0.1</version>
    <description>A wonderful project using JWebUnit</description>
    <dependencies>
        <dependency>
            <groupId>net.sourceforge.jwebunit</groupId>
            <artifactId>jwebunit-htmlunit-plugin</artifactId>
            <version>3.3</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
    

Download

If you don't want to use Maven, you can download files manually. First download latest stable version of JWebUnit from the releases area and expand to a local directory.

Choose what plugin you want to use

There are currently 2 available plugins:

  • HtmlUnit: A good choice if you want fast tests and good Javascript support.
  • Webdriver: BETA quality (not all the JWebUnit API could be executed with Webdriver)

Integrate with IDE

The simplest way to manage dependencies in Eclipse when you use Maven 2 is to use m2e plugin.

If you don't want to use Maven, make sure you add the jwebunit-htmlunit-plugin-XX.jar, jwebunit-core-XX.jar and all HtmlUnit dependencies (these files are in lib/ folder of the JWebUnit package) to your classpath in your IDE.