Forum Discussion
ChrisAdams
4 years agoSuper Contributor
Hi,
Is the below code snippet the part that is not working?
def RSholder = groovyUtils.getXmlHolder(StepName.toString()+"#Response")
RSholder.namespaces["xmlns"] = "http://webservices.sabre.com/sabreXML/2003/07"
def nodeRS = RSholder.getNodeValue("//xmlns:SabreCommandLLSRS/xmlns:Response")
Do you have other requests that go down this branch and if so, do they return the response?
dinojadhav
4 years agoOccasional Contributor
I guess this is code which is not working :
else{
def RQHolder = groovyUtils.getXmlHolder(StepName.toString()+"#Request")
RQHolder.namespaces["xmlns"] = "http://webservices.sabre.com/sabreXML/2003/07"
def nodeRQ = RQHolder.getNodeValue("//xmlns:SabreCommandLLSRQ/xmlns:Request/xmlns:HostCommand")
- ChrisAdams4 years agoSuper Contributor
Hi,
Try this to inspect the request....
def request = testRunner.testCase.testSteps[StepName].testRequest.response.getRequestContent(); log.info request; // Logs full XML Request def stuff = new XmlSlurper().parseText(request); log.info(stuff);Or, if your payload has multiple items...
def request = testRunner.testCase.testSteps[StepName].testRequest.response.getRequestContent(); def xml = new XmlParser().parseText(request); log.info(xml); for(item in xml){ log.info( item); }