Forum Discussion

Ferdinand_Aliwa's avatar
Ferdinand_Aliwa
Occasional Contributor
16 years ago

get current iteration number

Hi,
I am running a data driven testing. Is there method so that we can retrieve the current iteration number in the DataSource Loop during the execution? I need this for some input variables in my groovy script.

Also is there anyway to dynamically get the total number of row in Datasource? that can be accessed dynamically from the groovy script during execution?

Thanks,
Ferdinand
  • Hello,

    The DataSource TestStep has a method called getCurrentRow(), which returns the current row number. So in a Groovy TestStep for instance, you might access this with:


    testRunner.testCase.testSteps['DataSource'].currentRow


    There is no way to get the total number of rows until the loop has finished. Once done, you can get it through getCurrentRow.

    Regards,
    Dain
    eviware support