Forum Discussion

enliven's avatar
enliven
Contributor
16 years ago

DataGen Number doubles specified STEP-Count

Add Number to DataGen, set as:
Mode = READ
Shared = true (may not matter)
Start = 0
End = 999
Step = 1 (if 0, it wont count at all which makes sense)
Next Value = 0

Add this to a Groovy Script and Run it:

for(i in 0..99){
log.info(context.expand( '${DataGen#SeqInt}' ))
}


You will see the following in the log:
INFO:1
INFO:3
INFO:5
INFO:7
INFO:9


If STEP = 2 then it steps by 4:
INFO:2
INFO:6
INFO:10
INFO:14
INFO:18

If STEP = 3 then it steps by 6:
INFO:3
INFO:9
INFO:15
INFO:21
INFO:27