Forum Discussion
Hi,
The free SoapUI Open Source should be able to run fine via Maven:
https://www.soapui.org/test-automation/maven/maven-2-x.html
You often see pro-only etc on the SoapUI wiki, but there are two versions of the Maven SoapUI plugin. Here is a very simple snippet for version 5.0.0:
... <pluginRepositories> <pluginRepository> <id>SmartBearPluginRepository</id> <url>http://www.soapui.org/repository/maven2/</url> </pluginRepository> </pluginRepositories> <build> <plugins> <plugin> <groupId>com.smartbear.soapui</groupId> <artifactId>soapui-maven-plugin</artifactId> <version>5.0.0</version> <executions> <execution> <phase>test</phase>  <goals> <goal>test</goal> </goals> <configuration> <projectFile>src/test/resources/SOAPTest-soapui-project.xml</projectFile> </configuration> </execution> </executions> </plugin> </plugins> </build> ...
In terms of running SoapUI from within Eclipse, how exactly did you mean? Once the SoapUI dependencies are present, it can be quite easily run via Java, Groovy, Gradle, Maven..
In general, most things are possible in SoapUI O/S, sometimes with a little extra effort/thought and often with the help of Groovy scripts etc! :-)
Regards,
Rupert
- workpeter7 years agoOccasional Contributor
Hi Rupert,
Thank you, I have read all your posts on this thread. I have a question if i may.
I am attempting to run SOAPUI project via eclipse and Maven. I can see you've posted a POM will which contains the execution configuration, however id prefer to control the execution programmatically, so i can incorporate within my BDD solution.
Whilst it is possible to do so using the following code and i am having an issue:
import com.smartbear.ready.cmd.runner.SoapUITestCaseRunner;
SoapUITestCaseRunner runner = new SoapUITestCaseRunner(); runner.setProjectFile(projectFilePath); runner.run();
The code above executes if i run the project as an TestNG project ( i included the SOAPUI lib files to project), however when I run it as a Maven execution, then i get the following error:
java.lang.NoClassDefFoundError: com/smartbear/ready/cmd/runner/SoapUITestCaseRunner
I thought it should work since i did include the relevent SOAPUI references within the POM file (the only thing i removed was the execution details. Bellow is my POM file.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>SOAPUI</groupId> <artifactId>SOAPUI</artifactId> <version>0.0.1-SNAPSHOT</version> <dependencies> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>6.14.2</version> <scope>test</scope> </dependency> </dependencies> <pluginRepositories> <pluginRepository> <id>SmartBearPluginRepository</id> <url>http://www.soapui.org/repository/maven2/</url> </pluginRepository> </pluginRepositories> <build> <plugins> <plugin> <groupId>com.smartbear.soapui</groupId> <artifactId>soapui-maven-plugin</artifactId> <version>5.0.0</version> <!-- <executions> --> <!-- <execution> --> <!-- <phase>test</phase> --> <!-- <goals> --> <!-- <goal>test</goal> --> <!-- </goals> --> <!-- <configuration> --> <!-- <projectFile>src/test/resources/REST-Project-2-soapui-project.xml</projectFile> --> <!-- </configuration> --> <!-- </execution> --> <!-- </executions> --> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.21.0</version> <configuration> <suiteXmlFiles> <suiteXmlFile>testng.xml</suiteXmlFile> </suiteXmlFiles> <!-- <forkCount>3</forkCount> --> <!-- <reuseForks>true</reuseForks> --> </configuration> </plugin> </plugins> </build> </project>
i was thinking the SoapUITestCaseRunner class is missing, and i need to update my POM dependencies. However that aside, i think this is more an issue with Maven not picking up the SOAPUI jar files i've added as external library within the eclipse project.
Any ideas?
- charlesfradley9 years agoContributor
Thanks Rupert!
- charlesfradley9 years agoContributor
Hi Rupert and co,
I have added the above to my POM file, but I am still getting an import failure:
import com.eviware.SoapUI.tools.SoapUITestCaseRunner; [cannot be resolved]
Do I need to add a jar file to the project ? Or is maven supposed to take care of that ?
Thanks,
CFR.
My POM now looks like this:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>SoapUI_First</groupId>
<artifactId>SoapUI_First</artifactId>
<version>0.0.1-SNAPSHOT</version>
<pluginRepositories>
<pluginRepository>
<id>SmartBearPluginRepository</id>
<url>http://www.soapui.org/repository/maven2/</url>
</pluginRepository>
</pluginRepositories>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-maven-plugin</artifactId>
<version>5.0.0</version>
<executions>
<execution>
<phase>test
</phase>
<goals>
<goal>test
</goal>
</goals>
<configuration>
<projectFile>src/test/resources/SOAPTest-soapui-project.xml</projectFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>- rupert_anderson9 years agoValued Contributor
Hi,
Just to run Soapui project files with the Maven plugin, you should not need any additional libraries.
However, if your project contains Groovy scripts that require any libraries then these must be provided in the /ext folder, you can vary its location using a parameter:
mvn integration-test "-Dsoapui.ext.libraries=src/test/resources"
By the way there are newer versions of the maven plugin (the one in that pom is for version 5.0), take a look here for more options:
http://smartbearsoftware.com/repository/maven2/com/smartbear/soapui/soapui-maven-plugin/
Related Content
- 11 years ago
- 2 years ago