Search code examples
javajmeterjmeter-plugins

Jmeter: Issue with Constant Timer


Trying to simulate the follows:

  1. 10 users login [For each user auth token extracted and put in header manager].
  2. Do whatever action(s) [In the attached pic, this is dormant in the if controller].
  3. Logout each user [auth token required].

This works perfectly, until I add a constant timer between steps 1 & 3. It works as long as the timer is < 10 ms. When time is larger the auth token is duplicated [proportional to the timer] and logout fails for remaining users.

The image is updated to include a cookie manager. Observe the auth token header, this is the same for all requests when the timer is > 30 ms


Solution

  • Quite a silly mistake actually. I am extracting the auth token from the response body and saving it in a variable and then as a property which is then passed as a Jmeter Request Header for Authentication.

    When there is no delay. Jmeter has enough time to complete the entire login -> logout sequence before it initializes and starts the next thread. Hence there are no issues in this case. When we add a timer it is unable to complete the entire process and the new thread overwrites the new Property. Hence the problem.