Forum Discussion

kamatchipriya's avatar
kamatchipriya
Occasional Contributor
8 years ago

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 a...
  • 05ten's avatar
    8 years ago

    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!