cancel
Showing results for 
Search instead for 
Did you mean: 

Another datasource Q

Jon
Contributor

Another datasource Q

Probably a simple one... hopefully.

I now have a case where I have an inner and outer loop.  Trouble is, the inner loop not only  needs to read from a datasource, it also needs to modify the read value (an int) by multiplying it by the current loop iteration value. 

ie:

Read in value: 1000
Current OUTER loop iteration: first time through.
Value to be sent in webservice request: 1000 + (10 * 0)

Read in value: 1000
Current OUTER loop iteration: second time through.
Value to be sent in webservice request: 1000 + (10 * 1)

Read in value: 1000
Current OUTER loop iteration: third time through.
Value to be sent in webservice request: 1000 + (10 * 2)


Notice the increment (0, 1, 2, ...).

I guess I'd need to have a script take that read-in value, massage it appropriately and store it to a property, which I can then use in a later test step.  Just don't know how I'd write the script portion.

Note that at the end of each inner loop, the datasource will be reset and the read will begin again.  There are (for now, for simple testing) 10 values to be read in (1000-1009, hence the '10' in the calculation in the pseudo code block, above).  The outer loop is itself driven by another datasource, which is never reset.
2 REPLIES 2
Super Contributor

Re: Another datasource Q

Hi Jon,

how are you keeping track of the outer loop iteration value? (so I can get the script right..)

regards,

/Ole
eviware.com
Jon
Contributor

Re: Another datasource Q

Well, I'm totally open to suggestions for improvement, but at this time, I have a TestCase property that stores the value.
New Here?
Join us and watch the welcome video:
Watch the New Interview
APITestingMistake#2
Top Kudoed Authors
Top Kudoed Posts