Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

soapui random delay

Tags:

soapui

How to make a random delay between test steps with soapUI?

like image 620
Serhiy Avatar asked Apr 01 '11 08:04

Serhiy


2 Answers

Add Groovy Script step before each Request step with the next code that adds 0-9 seconds delay:

sleep(new Random().nextInt(10) * 1000)
like image 153
Artem Zankovich Avatar answered Oct 20 '22 23:10

Artem Zankovich


Exactly what you're looking for is the following.

  1. Add a Delay test step.
  2. Instead of filling a fixed number i.e. 500ms, use this expresion

    ${=(int)(Math.random()*10000)}

And change the 10000 with the multiplier that best suits your test.

like image 24
jezuito Avatar answered Oct 21 '22 01:10

jezuito