Forum Discussion

kerberose's avatar
kerberose
Occasional Contributor
11 years ago

[Resolved] Catch the Current Row number in Groovy script

hi,

When I run a test case that has a DataSource Loop step, the log shows the row number like "->Current row=1", how can I catch these numbers and pass to my groovy script within each iteration as a variable?



Thanks,

Rose
  • Hi,

    Why don't you use a property such as "count" and increment the value each run?


    def count = testRunner.testCase.getPropertyValue( "Count" )
    count = count + 1
    testRunner.testCase.setPropertyValue("Count",count)



    Regards,
    Marcus
    SmartBear Support