Forum Discussion
NeverBackDown
14 years agoOccasional Contributor
The problem is that I need to check not mockrequest but request from testCase.
I have tried to write it like this:
Error: com.eviware.soapui.impl.wsdl.mock.DispatchException: Failed to dispatch using script; org.apache.xmlbeans.XmlException: error: Unexpected element: CDATA
I have tried to write it like this:
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder("GetVehicleDetails#Request") // I need to check RegNo field from GetVehicleDetails request (GetVehicleDetails is teststep in testCase)
def a = mockOperation.mockService.project.getPropertyValue('RegNO')
if (holder["//*:RegNo"]=='a') // I need to compare value from GetVehicleDetails request (in RegNo tag) and value from variable RegNO (a)
return "Response 1"
else
return "MockResponse 2"
Error: com.eviware.soapui.impl.wsdl.mock.DispatchException: Failed to dispatch using script; org.apache.xmlbeans.XmlException: error: Unexpected element: CDATA