Hi There,
I’ve got some trouble in parsing my webservice response to remove all xml lines which include i:nil=“true”.
I have to do it because Katalon is not able to verify a text element with this script :
def response = WS.sendRequest(findTestObject(‘API’))
_if (WS.containsString(response, ‘:nil=“true”’, false)) _
println “The return API contain ‘:nil=true’”
WS.verifyElementText(response, ‘Response.Data.NextDeparture[0].Destination’, ‘Debourg’)
Here is my webservice response :
_ _
_ _
_ Debourg_
_ 1094_
_ 0_
_ _
_ _
_ _
_ Debourg_
_ 1099_
_ 0_
_ _
_ _
_ _
_ Debourg_
_ 1104_
_ 0_
_ _
_ _
_ _
_ _
_ 200_
Here is the log :
Unable to verify element text (Root cause: org.xml.sax.SAXParseException: The prefix “i” for attribute “i:nil” associated with an element type “JourneyActivityCode” is not bound.)
Does anyone of you already did it ? Could you help me please ?
Thank you very much !!
Best regards