Nour Mawla
Nour Mawla

Reputation: 63

JMeter run http requests consecutively in a ThreadGroup without loop logic

In JMeter, I have 2 Http Requests in a thread group, A and B

If I set Number of threads (users) to 3 in the thread group, they run in the following manner

AAABBB instead of the desired ABABAB

Why I need it AB, because A produces a unique connection ID I need to store in a variable and use in B. Now, all B requests uses the ID of the last A request.

Before anyone suggests it, I know setting users to 1 and loop to 3 will get the job done but in my specific use-case, it is causing errors.

To sum it briefly, I am using Azure signalR. When I am using only 1 user, Azure is only reserving 1 connection. As the loop progress, it closes the i-1 connection and opens it again at i.

So practically, at the end of the test, only 1 connection is open instead of 3.

I am unable to perform a stress test on Azure when there is only ever 1 connection opening and closing in each iteration.

So, how can I run the 2 http requests consecutively while keeping loop 1 and users 3?

Upvotes: 0

Views: 28

Answers (1)

Ivan G
Ivan G

Reputation: 2707

Each thread (virtual user) is running requests consecutively, you can check yourself if you add the following functions to your Samplers labels:

you will see that:

  • 1st user runs request A followed by request B
  • 2nd user runs request A followed by request B

If you're looking into a listener like View Results Tree and seeing another order - this is due to concurrency and it's totally expected

Upvotes: 1

Related Questions