Forum Discussion

Nico's avatar
Nico
Occasional Contributor
4 years ago
Solved

[Solved] DataSource Loops skips every other step

Hello

 

I have tests set up to iterate through datasets, but I noticed that not all tests are executed. Every other step is skipped by the DataSource Loop.

 

If I test the DataSource itself all data is generated. It doesn't matter if I get data from the built-in generator or fecth it from an external file.

I double-checked both Datasource and Loop options, and as far as I can tell everything is set up correctly.

 

This morning I build a quick debug test;

1. DataSource (which generates 10 numbered strings)

2. DataSink (storing the output in ReaduAPI and a txt file)

3. 1 second sleep

4. dataSource Loop.

 

Even this simple little test still skips every other numbered line, eg. it will do rows 1, 3, 5, 7, 9, 10.

I've attached scrshot at the bottom with all details of every relevant step in this debug test case. It should be relatively easy to reproduce the test.

 

OS: Windows 10, 64-bit
ReadyAPI 3.3.0 (and 3.0.0)

License: SoapUI Pro (Fixed)

 

I'm at a loss here.
Can someone please tell me why ReadyAPI skips every other line?

 

  • Hey Nico,

    Im ill at moment so cant be bothered to try and reproduce this at moment.
    However i noticed in your example you havent included a REST or SOAP or RunTestcase step. If i remember correctly the datasource loop needs these types of steps as the target otherwise it doesnt work properly.

    Thats all i got at the moment. I'll try and reproduce when i'm feeling better!

    Ta

    Rich

3 Replies

  • richie's avatar
    richie
    Community Hero
    Hey Nico,

    Im ill at moment so cant be bothered to try and reproduce this at moment.
    However i noticed in your example you havent included a REST or SOAP or RunTestcase step. If i remember correctly the datasource loop needs these types of steps as the target otherwise it doesnt work properly.

    Thats all i got at the moment. I'll try and reproduce when i'm feeling better!

    Ta

    Rich
    • groovyguy's avatar
      groovyguy
      Champion Level 1

      Nico : Seconding what richie said. There has to be some sort of test step between the Data Source and the Data Source loop. The way it works is the Loop increments the Data Source, but actually loops to the test step. With the way you have it, the Data Source is incremented by the loop, and then gets processed again by running itself from the loop.

    • Nico's avatar
      Nico
      Occasional Contributor

      Thanks, that was it.

      Even with just an empty groovy script test step my debug loop script now iterates through all rows.

       

      The same still doesn't happen for the actual script, but now I get another error which will be suitable for another thread.

      Again thanks, and groovyguy thanks to you too.