Closed rohit1212s closed 3 years ago
@rohit1212s please ask on stack overflow, actually if you search you will get answers: https://stackoverflow.com/search?q=%5Bkarate%5D+xpath
Hi,
I am looking to compare soap XML response with REST JSON response. The reason for ask is i have legacy app that generated soap xml response but as per new standards we are converting to REST JSON, is there a function avail in karate? I have tried xmlpath and xpath options and it didn't work so not sure what i am doing wrong?
I want to parse my xml response and assert some value but seems like karate doesn't support relative path in xml. when I give absolute path ex:- Envelope/Body/ns3:GetRevisionDetailsResponse/ns3:revision/ns3:revisionDetail/ns3:calculatedCost[1]/ns5:amount[1]/ns4:amount[1]/text()[1] == '#string' . It works but for this small xml I can give absolute but for huge xml file if I write the relative path it doesn't find ex:- //calculatedCost[1]/ns5:amount[1]/ns4:amount[1]/text()[1] == '#string' . Also if I want to validate response like if the response is Big integer or Big decimal . I am not able to suceed. see the below example:-