Forum Discussion

Ben_Lidgey's avatar
Ben_Lidgey
Occasional Contributor
16 years ago

[RESOLVED]Randomizing the returned row of an xl datasource

Hi,

I'm using xl as a datasource for two values

When I run the test, I want to select a random row from the 100 rows contained within the datasource.

I don't need to loop the values, I just need to ensure that each time the test is run, a different row is returned
At the moment, it only selects the very first row from the datasource

Just to reiterate, I dont need to push every value in the datasource one after the other (otherwise I would use a loop). I just need to ensure that each time the test is run it selects a random row containing the data.

Cheers
  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    Parameterize the "Start Row" option like this

    [tt:rxi550qn]${=new Random(System.currentTimeMillis()).nextInt(100)}[/tt:rxi550qn]