10 April 2007 - 1.7 |
soapUI provides a common ${[testStepName#]propertyName[#xpath-expression]}
syntax to dynamically
insert values into a number of values during processing. Currently, properties are expanded in:
When properties are expanded, soapUI will look for the named property as follows:
For example, the following request gets the Author property as described above, either from a preceding PropertiesStep containing the corresponding property or from the current context set by a preceding Groovy Script:
<ns:Request> <ns:Author>${Properties#Author}</ns:Author> </ns:Request>
Since the value of the property will be set just before it is used, the actual used value will not be seen in the corresponding editors.
If the property expansion further includes an xpath expression, this will be selected from the property value, for example the above example could "extract" the author value from a preceding response with:
<ns:Request> <ns:Author>${Search Request#Response#//ns1:Item[1]/n1:Author[1]/text()}</ns:Author> </ns:Request>
Which would first get the "Response" property of the "Search Request" step and then select the value of the first Items' first Author element. Note that the namespace prefix must match those used in the response message, otherwise the expansion will fail.
Property Transfers are a more tedious way of accomplishing the same functionality as with property-expansion. On the other hand, property transfers provide the possibility to transfer complex content between request/response messages. Also, the result of a Property Transfer is visible directly in the corrsponding request/response editors.
The table below lists all properties available for property-expansion and property-transfers
TestRequest Step | |
Property | Description |
---|---|
Request | The configures request message |
Response | The last response message (read-only) |
Endpoint | The current endpoint for the request |
Username | The current username for the request |
Password | The current password for the request |
Domain | The current domain for the request |
Properties Step | |
Property | Description |
<any defined property> | the properties' value |
GroovyScript Step | |
Property | Description |
result | the value returned by the script from its last run (read-only) |
DataSource Step (soapUI Pro only) | |
Property | Description |
<any defined property> | the properties' value (read-only) |
MockResponse Step (soapUI Pro only) | |
Property | Description |
Request | The last request message (read-only) |
Response | The configured response message |