5

I have a single thread group which has 3 requests and have set the Number of Threads(users) = 2.

I would like all the requests to be executed in sequential order for each user before it repeats these steps for the next user and so on.

Output expected:
HTTP Request 1_Thread 1
HTTP Request 2_Thread 1
HTTP Request 3_Thread 1
HTTP Request 1_Thread 2
HTTP Request 2_Thread 2
HTTP Request 3_Thread 2

However, the output results vary differently for each run and are not in the order I expect. How can this be corrected?
I have tried following but with no luck in achieving my output
1. Enable/disable "Run Thread Groups consecutively
2. Running the test in non-GUI mode

I have attached a screenshot as an image as I am not able to embed into this message yet.

Appreciate if anyone can help me with this query

Thanks
Output Screenshot enter image description here

0

1 Answer 1

3

For execution of Sampler Request by only Single Thread at a time use Critical Section Controller. For more info about Critical Section Controller Critical Section Controller

The Critical Section Controller ensures that its children elements (samplers/controllers, etc.) will be executed by only one thread as a named lock will be taken before executing children of controller.

Critical Section Controller takes locks only within one JVM, so if using Distributed testing ensure your use case does not rely on all threads of all JVMs blocking.

Practical Example:

  1. Place all your request under Critical Section Controller
  2. Run the test for any number of Threads you want
  3. Observe the Result in View Results Tree

Note : If you want to run it sequentially from 1 thread to N, make sure you provide Ramp Up Period properly.

enter image description here enter image description here enter image description here

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks a lot for this feature which i was not aware (just started Jmeter a few days ago).... This has worked as you have mentioned.. I will keep this in mind while running in distributed mod as per your suggestion. Thanks a ton !! :)
How to concurrently execute those request per users? I tried this but its like dont proceed to execute other users in my csv config

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.