Forum Discussion

pankaj51's avatar
13 years ago

giving error during the asseration validation ( i am using X

Hi ,

I am trying automate the build and deployment time verfication using the SOAP UI project by calling it using java code, that code is good and running but issue here is it giving error during the asseration validation ( i am using Xpath ) .

Please sugegst or help ....
Error is :
[[Contains At Least One Product] XPathContains assertion failed for path [declare namespace ns="http://www.tiptop.com/api/reference/version/one";
exists(//ns:ProductId)] : RuntimeException:java.lang.ClassCastException: org.apache.xmlbeans.impl.xpath.saxon.XBeansXPath cannot be cast to org.apache.xmlbeans.impl.store.SaxonXBeansDelegate$SelectPathInterface ]


the code I using ...

WsdlProject project = null;
StringBuffer strMessage = new StringBuffer();
try {
project = new WsdlProject(projectPath);
WsdlTestSuite testSuite = project.getTestSuiteByName("newXXX");
WsdlTestCase testCase = testSuite.getTestCaseByName("XXXAddress");
WsdlTestStep testStep = testCase.getTestStepByName("acceptsKnownXXXAddress");
WsdlTestCaseRunner runner = new WsdlTestCaseRunner(testCase, new StringToObjectMap());
TestStepResult stepResult = runner.runTestStep(testStep);

String[] messages = stepResult.getMessages();
for (int i = 0; i < messages.length; i++) {
strMessage.append("Message[" + i + "]" + messages[i]);
}
System.out.println(" stepResult " + stepResult.getStatus() + " Message :"
+ strMessage.toString() + " Error :" + stepResult.getError());
WsdlTestRequestStepResult eventWSDL = (WsdlTestRequestStepResult) stepResult;
System.out.println("eventWSDL 1= " + eventWSDL.getResponseContent());

} catch (XmlException e) {
System.out.println("Exception thrown :" + e);
e.printStackTrace();
} catch (IOException e) {
System.out.println("Exception thrown :" + e);
} catch (SoapUIException e) {
System.out.println("Exception thrown :" + e);
}



thanks in advance ...
Pankaj Singh

1 Reply

  • Try to remove any conflicts with xmlbean jar file in your project. I removed xmlbean-2.3.0.jar as soapui uses xbean-fixed-2.4.jar. If you are keeping all jars that are there in lib folder in your build path, then remove xmlbean older versions if any.

    Hope it helps.