Sneh Tripathi
Sneh Tripathi

Reputation: 430

Rerunning failed SoapUI tests using maven plugin with Java

We have created a maven Java application to run SoapUI tests using maven plugin 5.3. This project we run in Jenkins for Regression. To re-run the failed tests of SoapUI project after fixing we have to run the Jenkins job again for that project. Jenkins job gets the fixed (updated proejct xml after fix from SVN repository) tests and rerun all the passed and failed tests again.

Is there a way to re-run only the failed test in Jenkins?

Jenkins job:

  1. Get the updated SoapUI project xml from SVN
  2. Run the tests using a custom jar (plugin)

Plugin:

  1. SoapUI.setSoapUICore(new StandaloneSoapUICore(true));
  2. Create a WSDL project
  3. WsdlTestCaseRunner wsRunner = project.getTestSuiteByName(testSuiteName).getTestCaseByName(testCaseName).run(new PropertiesMap(), false);

Upvotes: 0

Views: 115

Answers (1)

Sneh Tripathi
Sneh Tripathi

Reputation: 430

I am able to do it by passing only test suites to run in a loop and run it using wrunner:

} else if (!testSuiteDisable && testSuitetoRerun != null) {

                for (int i = 0; i < testSuitetoRerun.size(); i++) {
                    testSuiteName = project.getTestSuiteByName(testSuitetoRerun.get(i).trim().toString()).getName();
                    for (TestCase testCase : project.getTestSuiteByName(testSuitetoRerun.get(i).trim().toString()).getTestCaseList()) {
                        testCaseName = testCase.getName();
                        startTime = System.currentTimeMillis();
                        boolean testCaseDisable = project.getTestSuiteByName(testSuiteName).getTestCaseByName(testCaseName).isDisabled();
                        if (!testCaseDisable) {
                            System.out.println("Running Test Case : " + testCaseName);
                            wsRunner = project.getTestSuiteByName(testSuiteName).getTestCaseByName(testCaseName).run(new PropertiesMap(), false);

Upvotes: 0

Related Questions