Forum Discussion

alibaba82's avatar
alibaba82
Super Contributor
13 years ago

Running tests in parallel via testrunner

Hello,
We are currently running a few projects via jenkins. Jenkins will run one projects at a time and soapUI in turns runs one test case at a time as well. For Jenkins jobs which has multiple large soapUI jobs, it can take 7-8 hours for a job to finish.

I know that soapUI GUI allows you to run tests in parallel. How can we achieve this via the testrunner ?

our typically testrunner setup in jenkins is
testrunner.bat <project name> -t<settings file> -f<output file> -j

It would be great if testrunner has a feature <threads> where you can specify/control how many concurrent tests should testrunner launch. I think this would greatly help speed up the execution of test cases.

Thanks

Ali

6 Replies

  • I found a way to force parallel processing of all my testCases with TestRunner.bat CLI
    Now I can execute a specific TestSuite in 5 seconds (parallel) instead of 45 seconds in sequence.

    Create a Groovy Script as the first testStep of your first testCase.
    Copy these line into this groovy script:

    import com.eviware.soapui.model.testsuite.TestSuite.TestSuiteRunType

    log.info testRunner.testCase.testSuite.getRunType()
    testRunner.testCase.testSuite.setRunType(TestSuiteRunType.PARALLEL)
    assert testRunner.testCase.testSuite.getRunType() == TestSuiteRunType.PARALLEL


    Be sure to locate this Groovy Script at the top of your test cases.
    TestSuite
    TestCase_1
    TestStep
    ThisGroovyScript
    TestCase_2
    TestCase_3
    ...


    Reference:
    http://www.soapui.org/apidocs/com/eviware/soapui/impl/wsdl/WsdlProject.html

    Chris Lessard
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi Ali,

    can't you just run the containing TestSuite or Project ? Or is it a subset of TestCases that you want to run !?

    regards!

    /Ole
    SmartBear Software
  • alibaba82's avatar
    alibaba82
    Super Contributor
    Hi /Ole,
    in my hudson job I have something like
    testrunner.bat <project name> -t<settings file> -f<output file> -j

    The project is quite big (couple thousand test cases). soapUI runs one test at a time. As such it takes quite a lot of time to run the whole project. If we can do something like

    testrunner.bat <project name> -t<settings file> -f<output file> -j -<number of parallel tests to run>

    soapUI can run n number of tests in parallel (via testrunner) and we can reduce the total run time.

    since we can run tests in parallel (via parallel feature in the testsuite), it would be helpful to have something similar in the testrunner.bat CLI. We obviously don't want to run all the tests in parallel as it would kill the system. so having a argument where we can specify the max number of test to run in parallel would be required.

    Ali
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi Ali,

    yes - sorry - i misread your first post - now I get it - I'll add a feature request for this - thanks!

    /Ole
    SmartBear Software
  • alibaba82's avatar
    alibaba82
    Super Contributor
    Hi /Ole,
    Any way customers (at least paying customers) can see the soapUI backlog. It would be easier to plan for thing on our side if we know when particular bug fixes or features are coming in.

    Thanks

    Ali