1

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.

Damu
  • 25
  • 4

1 Answers1

0

Make this change:

* xml res = data.response

We will be improving this in the next version, it would be good if you can test the develop branch and confirm: https://github.com/intuit/karate/wiki/Developer-Guide

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248