Need help - SoapUi testRunner.getStatus() is returning the status as "RUNNING" indefinitely

12,855

It sounds logical, as long as you are in the loop, the test is 'running'. You can get the status with this:

import com.eviware.soapui.model.testsuite.TestStepResult.TestStepStatus
myTestStepResult = testRunner.runTestStepByName("GetCitiesByCountry - Request 1")
myStatus = myTestStepResult.getStatus()
if (myStatus == TestStepStatus.OK)
log.info "The step status is: " + myStatus.toString()
else
log.error "The step status is: " + myStatus.toString()

Also, as the call to runTestStepByName is synchronous, there is no 'running' status, only 'CANCELED', 'FAILED', 'OK' or 'UNKNOWN'.

See the doc here

Share:
12,855
Som
Author by

Som

A Geek

Updated on June 04, 2022

Comments

  • Som
    Som almost 2 years

    In SoapUI after executing a soap request test step (which is under a test suite -> test case) through testRunner.runTestStepByName("Soap Request Name")

    and waiting for 10 seconds after that soap request execution testRunner.getStatus() is returning RUNNING status . below is the groovy script (which is under same test suite -> test case)

    import groovy.sql.Sql;
    import com.eviware.soapui.model.testsuite.TestRunner.Status
    
    testRunner.runTestStepByName("GetCitiesByCountry - Request 1")
    sleep(10000)
    log.info( "...${testRunner.getStatus()}...")
    
    while ( testRunner.getStatus() == Status.RUNNING ) {
        log.info(testRunner.getStatus())
    }
    

    the output is below

    Wed Apr 17 21:06:22 IST 2013:INFO:RUNNING
    Wed Apr 17 21:06:22 IST 2013:INFO:RUNNING
    Wed Apr 17 21:06:22 IST 2013:INFO:RUNNING
    Wed Apr 17 21:06:22 IST 2013:INFO:RUNNING
    Wed Apr 17 21:06:22 IST 2013:INFO:RUNNING
    Wed Apr 17 21:06:22 IST 2013:INFO:RUNNING
    .
    .
    continuing for infinite time...
    

    Ideally it should return FINISHED since the above test step is executed ,

    Advanced thanks for any help to this

  • Som
    Som about 11 years
    thanks @gaelperret ... but with above code the soapui showing the i value is 0 .. so for testRunner.results[i-1].status.... its giving "Array Index outof bound Exception:negative array index[-1]..." . so still get stuck with the same issue .
  • gaelperret
    gaelperret about 11 years
    @uday035, you are right, the above code works only if the step you run with 'runTestStepByName' is right before the current step. I corrected my answer.
  • naXa stands with Ukraine
    naXa stands with Ukraine over 9 years
    @gaelperret, according to the latest documentation there is no property TestStepStatus.CANCEL, only TestStepStatus.CANCELED