TransWikia.com

Random pause of 2 to 5 seconds between requests Jmeter

Software Quality Assurance & Testing Asked by Denis Filatov on November 28, 2021

I need to make a random pause of 2 to 5 seconds between requests. I suppose, that it is a constant timer with such settings as ${__Random(2000,5000)}. I can’t understand where should I create this timer: in thread group after all requests, or after every request in thread group? How can I check via listeners, that timer works correctly?

Thanks to Amol, I understood, that my config doesn’t work with multiple threads.

So I need 10 threads and 10 iterations with a random pause of 2 to 5 seconds between requests.

One Answer

If you want to have a random pause between every request, you need to add timer as 'sibling' to your samplers [requests], that means add constant timer as a child to thread-group.

How to use Constant Timer for random pause-

enter image description here

It won't make any difference if you add it as a first child or after all samplers. For better understanding, I suggest you to read scoping in Jmeter

Example here:-

enter image description here

You can easily see the randomness requests being made using View Results in Table. it has Start Time column which gives idea. I have used debug sampler for example again:

enter image description here

Hope this helps.

EDIT:-

If I disable the constant-timer, I can see all the request being made in the span of 1ms:

enter image description here

Answered by Amol Chavan on November 28, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP