joelgluth
16 years agoContributor
DataSources across TestSuites
I realise this is a Pro question, but since I'm using an evaluation license, I don't have a Pro forum account. So bear with me; my experience with using Pro to solve my problems has been mixed, but I'll buy it if I can convince myself it will work 
What I want is to be able to get the "next" value from a DataSource in more than one place, and to iterate over the DataSource in ways other than "loop over all the values until they're done".
One example of this might be having a DataSource at TestSuite scope. If I have a bunch of entities in my database and a file containing a list of known IDs for those entities, I want to be able to try and retrieve a different one each time, even though I'm not always performing the same operation. This could include being retrieved in a load test.
A simpler example might be having an API call that takes two arguments: foo(a, b), taken from dataSourceA and dataSourceB, respectively. I don't mind iterating over all the possible values of 'a', but I still want to get a fresh value of 'b' each time as well (though I don't care about covering all of them - I just want to ensure a cache miss).
Maybe I could access this through a Groovy dynamic property... some kind of getDataSourceStepByName("datasourceA").next() kind of idiom maybe?
Does this make sense? And is it possible?
J

What I want is to be able to get the "next" value from a DataSource in more than one place, and to iterate over the DataSource in ways other than "loop over all the values until they're done".
One example of this might be having a DataSource at TestSuite scope. If I have a bunch of entities in my database and a file containing a list of known IDs for those entities, I want to be able to try and retrieve a different one each time, even though I'm not always performing the same operation. This could include being retrieved in a load test.
A simpler example might be having an API call that takes two arguments: foo(a, b), taken from dataSourceA and dataSourceB, respectively. I don't mind iterating over all the possible values of 'a', but I still want to get a fresh value of 'b' each time as well (though I don't care about covering all of them - I just want to ensure a cache miss).
Maybe I could access this through a Groovy dynamic property... some kind of getDataSourceStepByName("datasourceA").next() kind of idiom maybe?
Does this make sense? And is it possible?
J