automatically increase number in request test step
Hello
i know we can use math.random function to generate random number in the request with ${=(Math.random())} everytime generate request.
can i do the same to increase integer value in the request?
initial value from test properties "id": 12345
test step:
<id>${#TestCase#id}</id>
how to loop request and each request will increment "id" value with +1
thx
Hi,
This recent solution hopefully addresses something very similar to what you are asking:
http://community.smartbear.com/t5/SoapUI-Open-Source/working-with-parameters/m-p/107273#M18540
(incrementing a property and using in a request)
You may also find the following solution complementry:
http://community.smartbear.com/t5/SoapUI-Open-Source/Conditional-goto/m-p/107284#M18543
(looping using a Groovy TestStep)
Bascially, the appraoch I normally use is:
1) Groovy TestStep - to handle initisation and increment of counter and set as property
2) Request TestStep - To use the couter property (using a property expansion)
3) (optional) Groovy TestStep - To loop if the counter has reached a certain value, a conditional Goto TestStep can also do this, but I prefer the flexibility of the Groovy option as described in the above post.
Thanks,
Rupert