Canoo Webtest WebTest Canoo

Extension Type parameterRef

Description

Pass a set of properties to a scenario.

This type allows you to select a set of properties by their name and pass them to an applet's scenario. The selection occurs with regular expression.

The type further maps the selected (ant or dynamic) property names to any scenario names. The scenario name can be set with regular expression's group.

Parameters

name
Required? yes
The name of the parameter in the scenario.
regex
Required? yes
A pattern to select properties to pass to the scenario.
propertyType
Required? no, default is The "defaultPropertyType" as specified in the "config" element is used.
The kind of properties to include. Either "ant" or "dynamic".

Details

The following example illustrates how to use the type parameterRef.

Consider a web application that operates in a single session with many similar items, such as an ordering tool. The test stores in the ant properties item.name.0 , item.name.1 , item.name.2 , item.name.3 and item.count.0 , item.count.1 , item.count.2 , item.count.3 names and count of items to use to fill forms in the test. At some point, the web application calls an applet that shows the state of the order. Webtest must hence pass the six properties to the applet.

parameterRef example
<appletRunner ...>
<parameterRef
  regex="user.name.(\d+)"
  name="name.\1"
  propertyType="ant"
  />
<parameterRef
  regex="user.count.(\d+)"
  name="count.\1"
  propertyType="ant"
  />
</appletRunner>

This example defines the two parameterRef that map ant properties to applet parameters. Their attribute regex defines a regular expression that match the words item.name. or item.count. followed by a group of digits. Their attribute name defines a pattern that starts with the words name. or count. and that ends with the first group of the regular expression, the digits.

The applet scenario receives then the eight properties name.0 ... name.3 and count.0 ... count.3, each one having the value of their corresping ant properties.

Usage

appletRunner.

news

Latest build: R_1705
Posted: 14-May-2008 13:13

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

WebTest 2.6 released, featuring upgrades to Ant 1.7, Groovy 1.5.4, and HtmlUnit 1.14.
The release includes support for data-driven testing, testing of drag-and-drop, advanced AJAX support, high-concurrency testing and reporting, real-time monitoring, and - as usual - lots of handling improvements.
Posted: 18 March 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