Karate get one variable from a request

问题内容:

    Given request
"""
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.openkm.com">
   <soapenv:Header/>
   <soapenv:Body>
      <ws:login>
         <!--Optional:-->
         <user>TestUser</user>
         <!--Optional:-->
         <password>TestUser</password>
      </ws:login>
   </soapenv:Body>
</soapenv:Envelope>
"""
When soap action 'http://ws.openkm.com/OKMAuth/login'
Then status 200
  * def token = //return

Result = response={soap:Envelope={={soap:Body={ns2:loginResponse={=‌​ {return=a866fb4f-47e‌​4-4895-ac13-2118b6c0‌​25c8}, @={xmlns:ns2=ws.openkm.com}}}}, @={xmlns:soap=schemas.xmlsoap.org/soap/envelope}}}, responseStatus=200, __loop=-1, responseCookies=null, token=a866fb4f-47e4-4895-ac13-2118b6c025c8}

I got this response from a request. How can I get the ‘return’ or the ‘token’ from the body?

问题评论:

原文地址:

https://stackoverflow.com/questions/47756777/karate-get-one-variable-from-a-request

Tags:, ,

添加评论

友情链接:蝴蝶教程