Forum Discussion

kamatchipriya's avatar
kamatchipriya
Occasional Contributor
7 years ago
Solved

Run Soapui project from maven

Hi,

 i am running soapui project from maven by adding dependency in pom.xml. it is working fine. but i want to run particular test cases from maven. Is there any option to add particular test case and test suite name? i am using soapui free version. Can anyone give suggestion for this?

 

Here is my code

<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-maven-plugin</artifactId>
<version>5.3.0</version>
<dependencies>
<dependency>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui</artifactId>
<version>5.3.0</version>
<exclusions>
<exclusion>
<groupId>javafx</groupId>
<artifactId>jfxrt</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<configuration>
<projectFile>soapui/user-provisioning-soapui-project_27_05_17.xml</projectFile>
<outputFolder>target/surefire-reports</outputFolder>
<junitReport>true</junitReport>
<exportAll>false</exportAll>
<printReport>true</printReport>
<projectProperties>
<value>Environment=devStagingVM1</value>
<value>endpoint_services="www.gmail.com"</value>
</projectProperties>
</configuration>
<executions>
<execution>
<id>soapUI</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>

 

  • It's possible. Under configuration tag you can specify testCase or testSuite. From the test-automation page for maven on soapui docs.

    testSuite : Specifies the name of the TestSuite to run
    testCase : Specifies the name of the TestCase to run

    I usually bind a property to specify which testcase/testsuite i want to run at the commandline. 

     

    <testCase>${soapui.testcase}</testCase>

    and bind the property soapui.testcase at top of pom file under project tag to an empty string like this.

     

     

    <project>
    ... <properties> <soapui.testcase></soapui.testcase> <soapui.testsuite></soapui.testsuite> </properties> ... </project>

     

     

    That way, by default, all tests are run. And if i want to run something in particular i can do the following. 

     

    #Just run My TestCase
    mvn clean install -Dsoapui.testcase="My TestCase"
    
    #Just run My TestSuite
    mvn clean install -Dsoapui.testsuite="My TestSuite"
    
    #run everything
    mvn clean install 

     

    Hope it helps!

6 Replies

  • 05ten's avatar
    05ten
    Contributor

    It's possible. Under configuration tag you can specify testCase or testSuite. From the test-automation page for maven on soapui docs.

    testSuite : Specifies the name of the TestSuite to run
    testCase : Specifies the name of the TestCase to run

    I usually bind a property to specify which testcase/testsuite i want to run at the commandline. 

     

    <testCase>${soapui.testcase}</testCase>

    and bind the property soapui.testcase at top of pom file under project tag to an empty string like this.

     

     

    <project>
    ... <properties> <soapui.testcase></soapui.testcase> <soapui.testsuite></soapui.testsuite> </properties> ... </project>

     

     

    That way, by default, all tests are run. And if i want to run something in particular i can do the following. 

     

    #Just run My TestCase
    mvn clean install -Dsoapui.testcase="My TestCase"
    
    #Just run My TestSuite
    mvn clean install -Dsoapui.testsuite="My TestSuite"
    
    #run everything
    mvn clean install 

     

    Hope it helps!

  • nmrao's avatar
    nmrao
    Champion Level 3

    No voice in maven.

    But, here is general info and hope this is useful.

    It depends on the usage.

    Build tools such ant, maven and CI tools like Jenkins can be used to execute the tests in whole uninterruptedly & without manual intervention and they best suites & work in this way.

    If you want to execute a single test case, may be need to look of for other best ways.

    What is your use case?

    • sanj's avatar
      sanj
      Super Contributor

      When ever I think of test cases using source, I am so inclined to use unit test frameworks such as JUnit.

       

      whats your plan and why would you want to run tests and test suites off a source code.

      Has it been modified so you need to use that source code?

       

      • skush05's avatar
        skush05
        New Contributor

        Hi ,

        Can anybody help me to execute soapui.xml project through maven.

        please mail me on skush05@gmail.com

        its very urgent please

  • pawanbelamkar's avatar
    pawanbelamkar
    Occasional Visitor

    Can you please share the process how to run Soapui project with Maven.