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.
<config .../>
<steps>
<-- steps which extract some values from the page ... -->
<storeProperty description="setting MyName=7.0" name="MyName" value="3+4" eval="true" />
<storeProperty name="tableSize" value="#{tableWidth} * #{tableHeight}" eval="true" />
<storeProperty name="gstAmount" value="#{totalAmount} / 11" eval="true" />
<storeProperty name="adjusted" value="(#{orig} - 1) * (${fudgeFactor} + 1)" eval="true" />
</steps>
</webtest>
WebTestRecorder