08 May 2007 - 1.7.1 |
Property Transfers are TestSteps that transfer properties between TestSteps, each containing an
arbitrary number of "property transfers" and each containing a
source and destination step and property specification with optional XPath expressions.
Property Transfers use the same Saxon XPath engine as described for the XPath Assertion. | ![]() |
The Property Transfer editor is opened by double-clicking a PropertyTransfer step either in the navigator or in the TestCase editors' TestStep-list.
The editor contains a list of configured transfers to the left, selecting a transfer in the list will displays that transfers source and destination XPath expressions to the right.
Use the top-right comboboxes to specify the source step/property to be transferred, the target step/property is specified with the combo-boxes in the middle. If the properties contain XML an accompanying XPath expression can be specified to further select the value to transfer from/to. soapUI Pro adds an XPath Selector button to the right of these combo boxes for easily selecting the source/target XPath expression from the selected source/target property.
The following actions are available from the bottom toolbar
Upon execution during a TestCase run, each transfer in the Property Transfer is performed by selecting the property specified by the transfers source step, property and optional XPath expression and copying their value(s) to the destination steps specified property using an optional XPath expression.
If XPath expressions are specified, soapUI will try to replace the target node with the source node if they are of the same type. If not (for example when assigning text() to an @attribute), soapUI will do its best to copy the value as possible.
Source and target XPath expressions must both point to existing nodes in their respective properties, the source property obviously requires the node so it can be selected, the target property requires the node so it can be found and overwritten.
If any of the transfers fail due to missing matches of any of the XPath expression, an error is printed and the step will either fail or go on, depending on of the "fail on error" option has been selected for that transfer. TestCase execution is only aborted if the TestCases' "Fail on error" option has been set as described for under TestCase Options.
The following options are available for each transfer:
A Property Transfer can be created as follows:
//ns1:SessionId
which will result in the sessionId element being copied
from the preceding response to the following request (where it must be available but preferably empty)with soapUI Pro creating property transfers is greatly simplified using the corresponding Response Wizards which perform most of the above steps automatically.
The following sample is also included in the sample project included in the offline distribution:
Set up 2 requests to the Amazon Web Service defined at (http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl);
<soapenv:Envelope xmlns:ns="http://webservices.amazon.com/AWSECommerceService/2006-02-15" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <ns:ItemSearch> <ns:SubscriptionId>- your subscription id here-</ns:SubscriptionId> <ns:Request> <ns:SearchIndex>Books</ns:SearchIndex> <ns:Title>Oxford</ns:Title> </ns:Request> </ns:ItemSearch> </soapenv:Body> </soapenv:Envelope>
and
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://webservices.amazon.com/AWSECommerceService/2006-02-15"> <soapenv:Body> <ns:ItemSearch> <ns:SubscriptionId>- your subscription id here -</ns:SubscriptionId> <ns:Request> <ns:Author>?</ns:Author> <ns:SearchIndex>Books</ns:SearchIndex> </ns:Request> </ns:ItemSearch> </soapenv:Body> </soapenv:Envelope>
and then create the following transfer which moves the first author from the
first requests "response" property to the author
request element in the following steps "request"
property;
Source XPath:
declare namespace ns='http://webservices.amazon.com/AWSECommerceService/2006-02-15'; (//ns:Author)[1]
Target XPath:
declare namespace ns='http://webservices.amazon.com/AWSECommerceService/2006-02-15'; (//ns:Author)[1]