View DatatransferTeststep

A Datatransfer teststep allows you to query results from SOAP teststeps (request and response) and store them in a variable. This is helpful in cases where you need to establish a set of requests where the input of a request is part of the response of the previous teststep.

See create teststeps, how to create a Datatransfer teststep.

Overview

When you create a Datatransfer teststep and select it in the Teststep list view, the following editor appears

. Datatransfer teststep Details screenshot
  • create new XPath expression opens a dialog to create an xpath expression to query data from a previous teststep (request or response) in this testcase.
  • .
  • create new XQuery expression opens a dialog to create an xpath expression to query data from a previous teststep (request or response) in this testcase. Note that you will use XPath in XQuery as well, so depending on your use case, XQuery may be the choice.
  • .
  • delete the selected datatransfers
  • rename the selected datatransfer
  • run datatransfer needs a referenced variable. See Reference variables for details
  • run result status displays the test run result status of an individual teststep.
  • enable/disable includes or excludes a datatransfer on a test run
  • move up and move down has impact on the list order and on the order they are invoked for test runs. As the datatransfers query teststep request and response they cannot have dependencies on each other. The order is intendedfor your organization, only.
  • Documentation of the pasteboard commands

Walkthrough to create an XPath datatransfer

We will create an XPath datatransfer (value provider) with a namespace-aware XPath expression. Be aware that we will use the request for this XPath expression. In general, you may use the response for your query

.

To make this work, you need to walk through our getting started tutorial. Once you are done, you need to change the request as follows:

We will query the value of msg:Element and store it in a testcase variable

        <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
        <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
            <soapenv:Header></soapenv:Header>
            <soapenv:Body>
                <msg:Enumerate xmlns:msg="http://schemas.xmlsoap.org/ws/2004/09/enumeration">
                    <!-- continue here -->
                    <msg:Element>USD</msg:Element>
                </msg:Enumerate>
            </soapenv:Body>
        </soapenv:Envelope>
        

Input configuration

Click with your mouse on the button create new XPath expression. This will open a dialog. Enter the name currency and confirm with ok. You will see the new datatransfer value provider in the list.

Datatransfer value provider details screenshot

Click with your mouse on the teststep Enumerate. This will link the teststep with the value provider and display the following view:

Datatransfer value provider details with referenced teststep screenshot
  • You may remove the current teststep reference with the button remove configuration.
  • read from You may switch to request/response of the referenced teststep to query data, default is response.

We need to reference the request for our walkthrough. For this reason the screenshot displays the value request after change from the default as the input type of the value provider.

We enter a simple, namespace aware XPath-Expression.

//msg:Element/text()

Now, we run this XPath expression and will get an error message

Click with your mouse on the button run XPath value provider

This will show an error message.

XPath expression with error

The reason for the error message is an unsatisfied mapping from the prefix to the namespace. This can be resolved very easily. Click on the button remove error message as we don't need this error message.

XPath expression with error

Switch to to the tab Namspaces and click with your mouse on the button preset namespaces from input teststep

XPath expression preset namespaces

This will load the namespaced defined in the input XML (request) with the prefixes used in the XML.

XPath expression namespaces loaded

You may run the XPath expression again, and will get error message that no variable has been loaded.


Create your own testcase variable currency. In case you're uncertain, how to proceed, see Create a VariableValueTransfer. Then run the value provider again. The result should be as follows:

XPath expression variable transfer successful