power_settings_new

How to manage authentication token in JMeter?

by (188 points)
asked
+1 vote
209 views
I have one doubt...

Thread Group
->20 -- User's
->30 -- Rmp Sec
->1 -- One Time

My page
->HTTP Request 1
->HTTP Request 2
->HTTP Request 3

Login
->HTTP Request 1
->HTTP Request 2
->HTTP Request 3

If I run the process for every 1.5 sec, the new user will visit my page and login to my page. For each user, it will generate new Authentication Token.

Thread Group
->20 -- User's
->0  -- Rmp Sec
->1  -- One Time

My page
->HTTP Request 1
->HTTP Request 2
->HTTP Request 3

Login
->HTTP Request 1
->HTTP Request 2
->HTTP Request 3

In this case, 20 users will visit my page and login to my page at same time. All 20 user's using the same token Authentication Token.

(i,e) one Authentication Token shared by 20 user's

When 20 user's visit my page and login to my page at the same time I need to generate the different token.

In Real Time If Two User login at same time means each user will have different authentication token

How to achieve this one in jmeter ?

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

2 Answers

answered by (142 points)
0 votes
Usually, through JMeter, you imitate get/post requests.

If a single token is being generated for multiple users, I suggest you verify your application.
answered by (13 points)
0 votes
Please share the error here so we can get better idea for answer. till then

Try to add cache and cookie manager first

then add reguler expression extractor after login request and get the token and put it in the request body.

I hope this will solve your problem
add
...