0
votes

I have a user flow (create base64 header auth > register request > Register > login > sending data) which I want to run simultaneously (100 users).

If I use the Thread Properties as it is, it will run in asynced way. Examples: User 3 will try to login with token of user 1, user 40 will register with registration header created for user 24 and so on.. Token for login extracted from base64 process, another token is extracted from 'register-request' and used as variable in 'registration' header.

I want first user to register with token created in first register-request and login with token created in base64 process, and so on for next users.

Is there a way to do so?

Thread

Flow

1

1 Answers

1
votes

Normally JMeter virtual users store variables in the thread-local storage so given your test plan design is good each thread (virtual user) should use its own header.

Not knowing the details of how your header is generated it's hard to say what's wrong, I would recommend using Debug Sampler and View Results Tree listener combination and double check the header value (and any interim variables) - hopefully you will be able to determine the cause. If not - you will need to share the test plan somewhere somehow.


Other things to consider:

  1. If your application requires Auhtorization header in form of username:password encoded into Base64 you actually don't need to generate the header manually, you can use HTTP Authorization Manager which automatically generates and adds the relevant header to the requests. Check out How to Use HTTP Basic Authentication in JMeter article for more details if needed.
  2. There is __base64Encode() function which you can use for encoding a custom string into Base64, the function can be installed as a part of Custom JMeter Functions bundle using JMeter Plugins Manager