Forum Discussion

electric_Insura's avatar
electric_Insura
Contributor
14 years ago

Datasource loop - get rid of last (extra) loop?

I have test cases that look like this:

1) Datasource
2) Groovy step - generate random number for use in request
3) Request - contains an assertion based on response content
4) Data sink
5) Datasource loop - loops back to the Groovy step each time to generate a new random number

The test always runs one extra loop to generate a new random number after there are no rows left in the datasource. A request is sent with no data, the request assertion fails, so the last loop always returns a failed result.

Any ideas on how to eliminate the last loop? I'm looking at the request properties but nothing is jumping out at me.

thanks.
  • Finan's avatar
    Finan
    Frequent Contributor
    Problem would seem to be in your loop....
    Can you provide the assertions/conditions which trigger the loop?

    Sounds like a basic mistake with counting logic, if you want 30 runs, you'll have to run the loop 29 times....
  • Hi!

    what kind of DataSource are you using? Could it contain one empty extra line/row/etc by mistake?

    regards!

    /Ole
    SmartBear Sweden
  • It's strange - the problem does not occur consistently, and my tests are set up pretty much the same. Datasource = Excel, Groovy generate random number step follows the data source step, datasource loop points back to Groovy step.

    In the end, I can always remove the row containing the failed test in my data sink.

    I have some other SoapUI issues that have arisen that are more pressing for me right now, but as I run my tests I'll see if I can determine which tests present the problem.