For one of my soap Request I get a response with special characters for < and > signs.
Because the response has these special characters, I could not run command like WS.getElementPropertyValue and get the correct value.
So I googled and found a way to change special chars to < > signs and also changed the file in pretty format. My question is now how do I go back from this
xml text file to response Object so I can run the command WS.getElementPropertyValue?
Thanks in advance
SOAP messages carry XML documents. A XML document contains a lot of
> characters. In XML,
> are nothing special.
I do not understand what you wrote. Please show us more info: your XML data, your test script, error log, etc.
Thank you for a quick response.
If the response didn’t have any special characters, I will do the following to get the value of Success Tag.
def locator1 = “GetUploadFeedbackResponse.Return.Transaction_Summary.Success”
response = findTestObject(‘ABC/GetTransactions’)))
String strMessageResponse = WS.getElementPropertyValue(response, locator1)
Here’s a response after I replace the special characters with <>. However this is in a text file test.xml now.
How do I get the <Success? tag value from the text file. 0
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope
@mqamar I can’t speak to your existing code but I can tell you I find dealing with XML much easier using GPathResult.
More info here:
Still I do not understand your problem.
Please show us the raw response BEFORE you do any character replacement.