Forum Discussion

paulie's avatar
paulie
Occasional Contributor
10 years ago

[Res]DataSource Loop with no initial rows?

I have a test case :

1) Groovy script - puts data in the Grid datasource
2) Datasource
3) Groovy step - uses some of the data from the datasource
4) Request
5) Datasource loop - to step 3

I'm looking to eliminate the first groovy step as I now need some data to be put in the datasource that isn't available until step3 generates it.

I'm looking to change it to
1) Datasource
2) Groovy step - calculate the data to be used in the loop and put it in the Grid datasource. Some of the data is retrieved from the Grid later in the script.
3) Request
4) Datasource loop - to step 2

Will this be able to loop around when the datasource is empty initially?
Can the number of rows be changed dynamically like this in the middle of a loop?
Will the groovy step be getting the data from row 0 when it accesses the Grid the first time through the loop?

If this won't work what are my alternatives e.g. is there a command to set the number of rows (and leave them blank or put dummy data in the rows initially)?
Thanks

3 Replies