first.feature Given ur ''
- def payload = read('')
- request payload
- soap action ''
- value = /Envelope/Body/Response/Result/Num
- print value # prints value correctly as expected
second.feature Background: *def fetch = read('first.feature') *def data = call fetch
Scenario:
- print data.response # prints the soap response in json format.
- def res = data.response
- print res["s:Envelope"][""]["s:Body"]["Response"][""]["Result"]["_"]["a:num']
first.feature works as expected ( response is in soap ) When I try to call this feature in another feature then the response is in json format.
I want to use a value from this response to pass it on to another request. I had to use res["s:Envelope"]["_"]["s:Body"][][].. to get to that.
Is there a way to easily fetch a value from this response as we do in first.feature? Please could anyone let me know how to achieve this.