SoapUI: Transfer Response Payload Value to New Request (Different Test Steps)

I'm trying to figure out SoapUI, and so far it's been a great tool. However, I cannot figure out this transferring of property stuff. I've read so much and just can't seem to find the answer I'm looking for.

I have one request: TC01_vorbereitenKunde

I receive the following Response Payload back:

HTTP/1.1 200 OK
X-Powered-By: Servlet/3.0
SOAPAction: "http://..."
Accept: text/xml
Content-Type: text/xml; charset=UTF-8
Content-Language: en-US
Date: Tue, 22 Sep 2015 15:58:01 GMT
Content-Length: 414
Content-Encoding: gzip

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <soapenv:Body>
    <nova-kunden:vorbereitenKundeResponse xmlns:nova-kunden="http://...>
      <nova-kunden:vorbereitungKundeAntwort>
        <status>true</status>
        <tkid>31f64d0f-b076-4304-95ab-15cb0de38adb</tkid>
        <meldungen/>
      </nova-kunden:vorbereitungKundeAntwort>
    </nova-kunden:vorbereitenKundeResponse>
  </soapenv:Body>

I then want to take the "tkid" value and place it in the following request: TC02_offeriereLeistungen

I've tried: ${TC01_vorbereitenKunde#Response#//tkid} "TC01_vorbereitenKunde" is the name of the Test Step where the response payload is from to no avail.

What am I missing? Thank you so much in advance for your help!

Upvotes: 0

Views: 629

Answers (1)

Rao
Rao

Reputation: 21359

Have script assertion for the first step as given below:

import com.eviware.soapui.support.XmlHolder
def xml = new XmlHolder(context.response)
def responseValue = xml.getNodeValue("//*:tkid")
assert null != responseValue, "Response does not have value"
context.testCase.setPropertyValue('TK_ID', responseValue)

In the second step, use ${#TestCase#TK_ID} where value is needed.

Upvotes: 1

Related Questions