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_1803
Posted: 17-Feb-2010 09:57

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