Canoo Webtest WebTest Canoo

Core Step storeProperty

Description

Provides the ability to store a given value into a property. It supports both dynamic properties and traditional ant properties.

Using the eval attribute indicates that the property should be treated as numeric and any simple expressions within the value should be evaluated. Brackets '(' and ')' as well as mathematical operators '+', '-', '*', '/' and '%' are supported. The result is treated as a double but converted back to a string before being stored into the property.

Parameters

value
Required? yes
The property value.
description
Required? no
The description of this test step.
eval
Required? no, default is false
A flag which determines if the value is to be treated as a mathematical expression to be evaluated.
name
Required? yes/no
The property name. Must be set if property is not set.
property
Required? no
The name of the property in which to store the retrieved value.
propertyType
Required? no, default is the "defaultPropertyType" as specified in the "config" element is used.
The type of the property in which to store the retrieve value. Either "ant" or "dynamic".

Inline Text

The inline text is all the text between the start tag ( <storeProperty> ) and the end tag ( </storeProperty> ), including blanks, tabs or newlines. Using a pair of start/end tags ( <storeProperty> </storeProperty> ) has not the same behavior than the seemingly equivalent empty element tag ( <storeProperty/> )! See this issue for an example.

Required? no
An alternative to the attribute value.

Details

The following examples illustrate various expression calculations.

storePropertyEvalExamples
<webtest name="storePropertyEvalTest">
  <config .../>
  <steps>
    <-- steps which extract some values from the page ... -->
    <storeProperty description="setting MyName=7.0name="MyNamevalue="3+4eval="true" />
    <storeProperty name="tableSizevalue="#{tableWidth} * #{tableHeight}eval="true" />
    <storeProperty name="gstAmountvalue="#{totalAmount} / 11eval="true" />
    <storeProperty name="adjustedvalue="(#{orig} - 1) * (${fudgeFactor} + 1)eval="true" />
  </steps>
</webtest>

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