Forum Discussion

JShah's avatar
JShah
Contributor
11 years ago

Limit Conditional Loop Count

Hi SoapUI Guys,

Is there a way we can check how many times the condition loop has been executed? and if sample it is now > 10 count how can I raise it as
an invalid assertion and proceed exit to the loop? I am checking groovy script but seems like I need time on doing some test - might be you had easy idea how to implement such requirements.

Regards

Paul

1 Reply

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

    You will have to use some Groovy to accomplish this. You can create a property to hold the number of times the test step has been executed. Then create a groovy script and call testrunner.fail() when the number has been exceeded.

    http://www.soapui.org/Scripting-Propert ... properties

    Another way is to use a datasource and datasink to read the count from a file, and use an assertion to fail the test case.

    Regards,
    Marcus
    SmartBear Support