Forum Discussion

SBerndt's avatar
11 years ago

TestSteps with xpath match fail using Java API

I struggle with different teststep results in Java and SoapUI concerning teststeps which use xpath matches.
In the SoapUI application the testrun is finished with no failures and when I use SoapUI via Maven Plugin (5.0.0) testcases fails when teststeps with xpath matches are used.

I've double checked if I use the wrong project file or call the wrong testcase.

This code works for testcases using only contains assertions:

protected void checkTestCase(TestCase testCase) {
TestCaseRunner tr = testCase.run(null, false);
for (TestStepResult tcr : tr.getResults()) {
System.out.println("Teststep: " + tcr.getTestStep().getName() + ": " + tcr.getTimeTaken()
+ "ms, Status: " + tcr.getStatus().toString());
}
}


What should I do to make xpath assertions work in the java project?
  • Hi,

    Please add an exclusion of the xmlbeans library that is used with the poi-ooxml library by modifying the poi-ooxml dependency as shown below.
    <dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi-ooxml</artifactId>
    <version>3.10-FINAL</version>
    <exclusions>
    <exclusion>
    <groupId>org.apache.xmlbeans</groupId>
    <artifactId>xmlbeans</artifactId>
    </exclusion>
    </exclusions>
    </dependency>

    Also, please confirm the version of the plugin you are using.

    Thanks,

    Giscard
    SmartBear Support