Huzefa
Huzefa

Reputation: 119

JMeter: using synchronizing timer with If Controller

My requirement is I want 10 users logging in(using login credentials from CSV) with simultaneous login of 5 users, with each user traversing different paths depending on which user has logged-in. Below is my Test Plan for the same: Test Plan

Below is synchronizing timer settings which I have used: synchronizing Timer settings

I have clubbed my requests in a transaction controller since each main request has multiple concurrent sub-requests Plus i want to put requests for all JS, css, image files as one parent request. I am considering 1 request to include all the requests within each Transaction controller.: Requests clubbed within transaction controller

As per my Test Plan, if my understanding is correct then, 1st user will login and the request continues to "If controller" of User1. Here requests will wait till 5 requests have been queued as per setting done in synchronizing timer and all the 5 requests will be sent to the server at one time. Then 2nd user will login and the requests of the second user will be processed and so on.

The above test plan executes successfully if synchronizing timer is not used. Once I use the synchronizing timer, my test plan execution continues indefinitely.

As per my understanding of synchronizing timer, the processing should continue since I have used timeout value of 200000 MilliSecs. I am unable to understand why on using synchronizing timer the Test Plan hangs.

What i actually want is first all 10 users should login with 5 simultaneous logins and then each user continue with their respective requests as per the condition specified in the If Controller(${__groovy(vars.get("username") == "user1" )}), with 10 simultaneous requests.

So, how do i design my Test Plan along with use of synchronizing timer to achieve the desired result?

I will greatly appreciate inputs from seasoned JMeter experts. Thanks!

Upvotes: 0

Views: 827

Answers (1)

Ori Marko
Ori Marko

Reputation: 58772

It seems the you want the synchronizing timer to work specifically when 10 users are entering the if controller.

Because Timers are executed before every Samplet in scope,

timers are processed before each sampler in the scope in which they are found;

In your case you just need to move timer under request 1 inside controller.

Currently you are trying to sync all samplers in flow, and you don't need to wait on every sampler

Upvotes: 1

Related Questions