cancel
Showing results for 
Search instead for 
Did you mean: 

Exception in the readyAPI log when re-running failed test case with testCase.run in soapUI project

Occasional Visitor

Exception in the readyAPI log when re-running failed test case with testCase.run in soapUI project

I am trying to re-run failed test cases after catching the failure in the test steps with testCase.run(null, false), that I put the following script in teardown script of a test case 

def hook = new CaseHook(); hook.teardown(context, testCase, testRunner, log)

 

in CaseHook.groovy,

 

class CaseHook {

 

    static boolean isRetry = false

    void teardown(context, testCase, runner, log)

    {   

        def proj = testCase.getTestSuite().getProject()

        log.info "The running project is: $proj.name"

                    

        if ("$proj.name" == "SampleProject")

        {   

            for (result in runner.results)

            {   

                if (result.getStatus().toString() == 'FAILED')

                {   

                    def suite = testCase.getTestSuite()

                    log.info "FAILED test step : [$suite.name]->[$testCase.name]->[$result.testStep.name]"

            

                    if (! CaseHook.isRetry)

                    {   

                        log.info "Re-run the test case : [$testCase.name]"

                        CaseHook.isRetry = true

                            

                        testCase.run(null, false)

                    }   

                    else

                    {   

                        log.info "Already re-run [$testCase.name], move on"

                        CaseHook.isRetry = false

                    }   

                }   

            }   

        }   

            

        log.info "-- Called Case teardown [$testCase.name]"

    }

 

 

when running the test case ( it's designed to failed), no exception is thrown in readyAPI log and the test case is re-run . However, run it with clicking the run button of the suite or the project,  it can be re-run but got following exception in readyAPI log, any suggestion? 

 

Mon Apr 25 17:40:53 CST 2016:ERROR:Error in TestSuiteRunListener
java.lang.IllegalStateException: Test case run with execution id: doesn't belong to test suite run with execution id: 4ab7bb97-e4fa-4e3e-af07-84ee7c3e703a
at com.eviware.soapui.impl.wsdl.history.TestSuiteRun.addTestCaseRun(TestSuiteRun.java:18)
at com.eviware.soapui.impl.wsdl.history.TestSuiteRunHistory.addTestCaseRun(TestSuiteRunHistory.java:28)
at com.eviware.soapui.impl.wsdl.history.DefaultLatestRunsProvider.a(DefaultLatestRunsProvider.java:302)
at com.eviware.soapui.impl.wsdl.history.DefaultLatestRunsProvider.a(DefaultLatestRunsProvider.java:274)
at com.eviware.soapui.impl.wsdl.history.DefaultLatestRunsProvider.a(DefaultLatestRunsProvider.java:247)
at com.eviware.soapui.impl.wsdl.history.DefaultLatestRunsProvider.getLatestNonArchivedRun(DefaultLatestRunsProvider.java:108)
at com.eviware.soapui.impl.wsdl.panels.testsuite.ProWsdlTestSuiteDesktopPanel$InternalTestSuiteRunListener.afterRun(ProWsdlTestSuiteDesktopPanel.java:646)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestSuiteRunner$1.notifyListener(WsdlTestSuiteRunner.java:180)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestSuiteRunner.notifyListeners(WsdlTestSuiteRunner.java:235)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestSuiteRunner.notifyAfterRun(WsdlTestSuiteRunner.java:177)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestSuiteRunner.internalFinally(WsdlTestSuiteRunner.java:170)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestSuiteRunner.internalFinally(WsdlTestSuiteRunner.java:1)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:154)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors