Forum Discussion

skush05's avatar
skush05
New Contributor
5 years ago

Run SoapUi project(.xml extention) through maven through

Hi Friends,

I want to Run SoapUi project(.xml extention) through maven.
Can anybody help me in that please.
Its bit urgent
skush0005@gmail.com

  • peti2005's avatar
    peti2005
    Occasional Contributor

    hello skush05 

     

    I guess I can help with. Just few days ago a made it happen.

    1. Setup maven and make sure that your command line recognices the "mvn" command. For details look here

    2. Create a pom.xml file and place it to the same folder where your SoapUI test project is located

    3. The content should look like this (for more details look here):

    <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/maven-v4_0_0.xsd">
      <modelVersion>4.0.0</modelVersion>
      <groupId>YOUR_GROUP_ID</groupId>
      <artifactId>YOUR_ARTIFACT_ID</artifactId>
      <packaging>jar</packaging>
      <version>1.0-SNAPSHOT</version>
      <name>YOUR_NAME</name>
      <description>YOUR_DESCRIPTION</description>
      <url>http://maven.apache.org</url>
      <pluginRepositories>
        <pluginRepository>
          <id>SmartBearPluginRepository</id>
          <url>http://smartbearsoftware.com/repository/maven2/</url>
        </pluginRepository>
      </pluginRepositories>
      <build>
        <plugins>
          <plugin>
            <groupId>com.smartbear.soapui</groupId>
            <artifactId>soapui-maven-plugin</artifactId>
            <version>5.3.0</version>
            <dependencies>
    	<dependency>
    		<groupId>com.microsoft.sqlserver</groupId>
    		<artifactId>mssql-jdbc</artifactId>
    		<version>7.4.1.jre8</version>
    		<scope>runtime</scope>
    	</dependency>
    	</dependencies>
            <configuration>
              <projectFile>YOUR_TEST_PROJECT.xml</projectFile>
              <outputFolder>${project.build.directory}/reports</outputFolder>
              <junitReport>true</junitReport>
              <printReport>true</printReport>
              <testSuite>YOUR_TEST_SUITE</testSuite>
              <soapuiProperties/>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </project>

       In this example we use also database connection via JDBC driver from micrososft. You can see how it is       specified in dependencies section

    4.Open command line tool (in Windows it is cmd) and navidate to the folder where the test project and pom xml files are located

    5. To run 1st time and resolve/download dependencies: mvn install
    6. To execute test suite specified int he pom.xml: mvn  com.smartbear.soapui:soapui-maven-plugin:5.3.0:test

     

    As successfull result you will get something like

    oapUI 5.3.0 TestCaseRunner Summary
    -----------------------------
    Time Taken: 42743ms
    Total TestSuites: 1
    Total TestCases: 632 (0 failed)
    Total TestSteps: 2528
    Total Request Assertions: 632
    Total Failed Assertions: 0
    Total Exported Results: 0
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time:  667.296 s
    [INFO] Finished at: 2019-11-27T14:31:28+01:00
    [INFO] ------------------------------------------------------------------------ 

     NOTE: Before doing it on remote machine (where CI server is running) I recommend to try it 1st on local machine.