I am sending a request that returns a response in XML. When the response first comes back I can extract values from the XML as shown in the example below.
* def balanceAmount = $response/Envelope/Body/balanceAmount/amount
And print balanceAmount
However I then send another request so the above response is overwritten - so I need to save it as XML - so I can recall the values later on in the test.
I have tried many ways of doing this including the following:
* def xmlResponse = $response
* def xmlResponse = response
* xml xmlResponse = $response
* xml xmlResponse = response
But I can no longer access the values in the XML response like I could earlier.
I've tried these:
* def balanceAmount = xmlResponse/Envelope/Body/balanceAmount/amount
And print balanceAmount
* def balanceAmount = $xmlResponse/Envelope/Body/balanceAmount/amount
And print balanceAmount
None of the above works.
So how can I save the xml response as xml so I can extract values from it later on in the test after sending a different request?