Forum Discussion

mcjeff2002's avatar
mcjeff2002
New Contributor
13 years ago

SoapUI TestCase Result And Loops

Hello,
I build a testsuite with Soap Requests but i have a probleme with the Global Test Case Result.

I have asyncronous request in my test case :

1rt request : submit a requette of searching some informations (the response is a ticket number)
2nd request : get the response (with the ticket number) if it is ready.

I made a loop to look for the result of my get , i try 10 times maximum.
My loop works fine but if the get response failed 1 time (because the result was not ready) and at the 2nd try it is ok, the global result of my test suite is "FAILED" because 1 try failed.

Is it possible to set a parameter in soapUI to tell it to keep the last request status to make the Global test suite Status ?

The solution shoud be to uncheck "Fail TestCase on Error" but If I do that, when the a TestStep realy failed the GlobalStatus is Green !

Could you advice please ?

This is my loop :


loop= Integer.parseInt(testRunner.testCase.getPropertyValue("tmploop"))
max= Integer.parseInt(testRunner.testCase.getPropertyValue("Max_retry"))
delay= Integer.parseInt(testRunner.testCase.getPropertyValue("Ticket_retry_delay"))

log.info loop

previousResponse = testRunner.testCase.getTestStepByName('SessionHistory Get').testRequest.response.contentAsString;

if (!(previousResponse.contains('TERMINATED')) & (loop < max ))
{
loop++
sleep delay
testRunner.testCase.setPropertyValue("tmploop",loop.toString())
testRunner.gotoStepByName('SessionHistory Get')
log.info loop
}
else
{
testRunner.testCase.setPropertyValue("tmploop","0")
}





  • Aaronliu's avatar
    Aaronliu
    Frequent Contributor
    may you can configure your test case: right-click on one test case, and then select option, you'll see:
    Abort on Error: selected. means if one step failed, then skip it and continue to next step