Canoo Webtest WebTest Canoo

Installing WebTest

Prerequisites

A platform that is able to run Java.
An installed JDK version 6 or higher.
Ant version 1.8.4 or newer (optional)
WebTest's distribution contains the necessary part from ant 1.8.4 ready to run
A tool to unzip.

Download

Download the latest build from: Downloads.

Extract it to a directory of your choice. We refer to that directory as your WebTest home.

Configure system path

The sub-directory lib/ of your WebTest home contains all the java libraries that make up WebTest's runtime. The sub-directory bin/ of your WebTest home contains shell scripts for Unix and Windows that start WebTest from lib/.

Set your path to run WebTest with one of the provided shell scripts:

On Windows
Add the bin/ directory of your WebTest home to your path, by opening up the System Properties (WinKey + Pause), selecting the Advanced tab, and the Environment Variables button, then editing the PATH variable in the user variables.
For example:
"C:\Program Files\Webtest\bin";%PATH%
Unix-based Operating Systems
Add the bin/ directory of your WebTest home to your PATH.
For example:
setenv PATH ${PATH}:/usr/local/webtest/bin in .login (tcsh)
or
export PATH=${PATH}:/usr/local/webtest/bin in .bashrc (bash).

Create a new WebTest project

WebTest contains a utility script able to create a new project with some examples ready to run.

Open a new shell and type:

C:\> webtest -f path\to\webtest\home\webtest.xml wt.createProject

(For shell users, the command name is webtest.sh instead of webtest)

You will be asked for the name of the new project to create. If you just hit [enter] the default name myWebTestProject will be used;

C:\> webtest -f WebTest\webtest.xml wt.createProject
Buildfile: WebTest\webtest.xml

wt.init:

wt.createProject:
[input] Enter your WebTest project name: [myWebTestProject]

[echo]
[echo] Your WebTest project >myWebTestProject< has been successfully created with some demo
[echo] tests to get started.
[echo] You can now just go to >c:\myWebTestProject< and run ant.
[echo]

BUILD SUCCESSFUL
Total time: 7 seconds

Run the demo tests

Your newly created project contains some web tests ready to run that you can use as templates. You can run them just by moving to the project directory and calling:

C:\myWebTestProject> webtest

(if you're behind a proxy, edit the build.xml file to configure the proxy connection)

You should see some activity in the shell window and after a few seconds something like:

....
wt.openResultFile:
[echo] Opening result file C:\myWebTestProject\results\webtestResults.html with cmd

wt.full:

BUILD SUCCESSFUL
Total time: 16 seconds

and an html report file like this one should be displayed in your favorite browser:

news

Latest build: R_1825
Posted: 23-Apr-2014 10:47

WebTest 3.0 released, featuring upgrades to Java 5, Groovy 1.6, and HtmlUnit 2.4.
The release includes support for maven integration, IDE-integration like for unit tests, capturing of background JavaScript errors, new steps for mouseOver and mouseOut events, better parallel execution of tests and - as usual - lots of handling improvements.
Posted: 5 March 2009

WebTest @ JavaOne
Dierk König presented "Functional testing of web applications: scaling with Java" on Wed May 7, 13:30 at JavaOne 2008 in the Tools and Scripting Languages track.
Posted: 8 May 2008

New WebTest screencast available:
Data Driven WebTest
Posted: 13 November 2007

First WebTest screencast available:
Creating a first Webtest Project

Extend WebTest with Groovy! Groovy in Action is available in every good bookstore.
Groovy in Action
Posted: 29 January 2007