10 April 2007 - 1.7 home user-guide eclipse jbossws intellij netbeans maven 1.X/2.X PDF files forums bugs sourceforge






Vote for soapUI at the WSJ Readers' Choice awards in the

'Best Web Services Utility' and

'Best Web Services Testing Tool'

categories

Property Expansion

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:

  • request messages
  • mock response messages (from the MockRunContext see Response Scripts), testStepName is ignored.
  • xpath assertions and their matching values
  • xpath source/target property transfers
  • contains/not-contains content assertions
  • request endpoints
  • custom request/mock-response http headers
  • property-transfer xpath expressions
  • datasource step configuration values (soapUI Pro only)
  • mockresponse step response messages (soapUI Pro only)

When properties are expanded, soapUI will look for the named property as follows:

  1. if the property contains the name of a testStep, query that step directly
  2. in the current run/submitcontext where properties can have been set from a groovy-script
  3. in all teststep properties starting from the current step backwards to the first if the "Search Properties" option has been selected in the TestCase Options dialog)

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.

Available Properties

The table below lists all properties available for property-expansion and property-transfers

TestRequest Step

PropertyDescription
RequestThe configures request message
ResponseThe last response message (read-only)
EndpointThe current endpoint for the request
UsernameThe current username for the request
PasswordThe current password for the request
DomainThe current domain for the request

Properties Step

PropertyDescription
<any defined property>the properties' value

GroovyScript Step

PropertyDescription
resultthe value returned by the script from its last run (read-only)

DataSource Step (soapUI Pro only)

PropertyDescription
<any defined property>the properties' value (read-only)

MockResponse Step (soapUI Pro only)

PropertyDescription
RequestThe last request message (read-only)
ResponseThe configured response message


Next: LoadTesting