Xpath validation fails when automated testing with maven / soap-ui plugin
We are using Soap-UI to write some web service tests.
I put this XPath check in one of these:
count(//mynode) > 1
This works fine when running SOAP-UI software, but when continuous integration (jenkins) runs it through the Maven Soap-UI plugin, I get this error:
[XPath Match] junit/framework/ComparisonFailure
I am guessing there is a library missing somewhere, but can't figure out what to do.
It's weird that I don't link to any jUnit tests as I am just calling the webservices url.
+3
source to share
1 answer
Finally I found that there is a junit dependency to add using this thread
Here is the dependency I had to add to my pom.xml file:
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
</dependency>
</dependencies>
For maven-soapui-plugin.
The whole configuration will look like this:
<plugin>
<groupId>eviware</groupId>
<artifactId>maven-soapui-plugin</artifactId>
<version>4.0.1</version>
<executions>
<execution>
<id>services-customer</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<projectFile>services/customer/smoke-tests.xml</projectFile>
<projectProperties>
<value>IdmpDataEndPointHost=${smoke.dataload.url}</value>
<value>WebServiceEndPointHost=http://${smoke.tomcat.server}:${smoke.tomcat.port}</value>
</projectProperties>
<outputFolder>${project.build.directory}/soapui-results/services/customer</outputFolder>
<junitReport>true</junitReport>
<testFailIgnore>true</testFailIgnore>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
</dependency>
</dependencies>
</plugin>
+3
source to share