I have this meter job for which I need to build some think time between certain HTTP Requests. But during those thinking time I still need to send a keep alive request on specific interval.
For example:
- User login
- get some profile information.
- Then he start to do some work.
each unit of work is delayed by some random delay varying from 1 to 30 minutes. During that time we still need to send to there server a ImAlive request at fix interval (like 5 minutes). Once the thinking time is expired which could be at 17m12s for example, then the loop exit.
For simulate the delay you can use Runtime Controller which will be executed with given seconds you define the keep alive requests, inside Runtime Controller add Timer as Gaussian Random Timer to add delay between keep alive requests.
You can use While Controller with condition like:
Where:
${TESTSTART.MS}
- pre-defined JMeter property where test start time lives1032000
- milliseconds representation of17m12s
-(17 * 60 + 12) * 1000
So children of the While Controller will be executed for 17 minutes and 12 seconds after test start. If needed you can add another condition just in case you want to exit the loop earlier. See Using the While Controller in JMeter guide for more details.