/* Google Analytics ----------------------------------------------- */

Thursday, June 11, 2009

JwebUnit ... HTMLUnit + Selenium

JWebUnit is a Java-based testing framework for web applications. It wraps existing testing frameworks such as HtmlUnit and Selenium with a unified, simple testing interface to allow you to quickly test the correctness of your web applications.

JWebUnit provides a high-level Java API for navigating a web application combined with a set of assertions to verify the application's correctness. This includes navigation via links, form entry and submission, validation of table contents, and other typical business web application features.

The simple navigation methods and ready-to-use assertions allow for rapid test creation. See example below:

public class ExampleWebTestCase extends WebTestCase {
public void setUp() {

public void test1() {
setTextField("username", "test");
setTextField("password", "test123");
assertTitleEquals("Welcome, test!");

To use JWebUnit you only need to download the latest release JARs and include them into your project classpath.