Canoo Webtest WebTest Canoo

Available Core Steps

This is the syntax documentation for the Core steps.

The webtest task includes all information about a test specification. It contains the nested tasks config (soon to be optional) which defines configuration information and steps (soon to be optional) which defines a sequence of test steps.

The steps element can contain any number of Core, Extension, PDF or grouping test steps. A recent feature is that you can also mix in normal ANT tasks as well. You can use the antWrapper step or just add them in and an antWrapper step will be added implicitly for you. This is fairly new and hasn't had extensive testing yet - use with caution.

The main Core steps provide the ability to invoke pages, store and verify various information about visited pages, and manipulate HTML forms and include: invoke clickLink clickButton followFrame previousResponse verifyTitle verifyText verifyElement verifyElementText verifyTextarea verifyInputField verifySelectField verifyLinks verifyXPath verifyCheckbox verifyCookie setCheckbox setInputField setRadioButton setSelectField storeRegEx storeProperty storeXPath storeDynamicProperty storeCookie storeHeader verifyProperty

Test steps can be further grouped (and even nested) using the following steps: group not repeat ifStep timedGroup retry

In addition, there are special steps which help set appropriate context information, e.g. selectForm can be used to select a particular form as the current form and verifyText can contain the table locating step.

Most of the steps work on the "current page" (actions like clickLink, clickButton, ... as well as verifications like verifyTitle, verifyInputField, ...). The notion of "current page" is quite simple when no JavaScript is involved: it is the result of the last action step triggering a request (invoke, clickLink or clickButton) or the frame followed by followFrame or the response restored by previousResponse. It becomes more complicated when JavaScript is involved but it aims to be as "natural" as possible. A newly loaded page becomes the new "current response" if one of the following conditions applies:

the page is loaded in the window of the current response
the page is loaded in a new window
the page is loaded in a frame which enclosing page is already loaded and the load was not triggered by JavaScript

Furthermore if the window containing the "current response" is closed, then the content of the last opened window becomes the "current response".

Proxy settings configured with the ant <setproxy> task prior to webtest are used to access the website to test.

news

Latest build: R_1823
Posted: 20-Feb-2013 12:26

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