Eviware Forum

soapUI => soapUI => Topic started by: Jon on May 30, 2008, 07:50:12 pm



Title: Another datasource Q
Post by: Jon on May 30, 2008, 07:50:12 pm
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:

Code:
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.


Title: Re: Another datasource Q
Post by: omatzura on May 30, 2008, 11:33:34 pm
Hi Jon,

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

regards,

/Ole
eviware.com


Title: Re: Another datasource Q
Post by: Jon on June 02, 2008, 02:25:34 pm
Well, I'm totally open to suggestions for improvement, but at this time, I have a TestCase property that stores the value.