Spanky
Spanky

Reputation: 121

JMeter - Define and use 100 distinct users to send HTTP request

I have a simple JMeter Testplan which shall send an HTTP request with basic authentication. I have defined an HTTPAuthorizationManager with 100 users and their passwords. Plan is that JMeter runs this Test Plan indefinitely with 100 distinct users and shall use all 100 users defined in the HTTPAuthorization Manager. It basically executes that but only uses the credentials of the first user in the list and not all of them. So in my application I see only HTTP requests of the first listed user.

How to configure the TestPlan that it uses all 100 users defined in the HTTPAuthorizationManager and not only the first in the list?

Upvotes: 0

Views: 198

Answers (2)

Dmitri T
Dmitri T

Reputation: 168042

If you have a setup like this:

enter image description here

it won't iterate all usernames, you need to:

  1. Add a CSV Data Set Config to your test plan and point it to the file with your username/password combinations:

    enter image description here

  2. Remove all these 100 lines from the HTTP Authorization Manager and replace them with a single line with the JMeter Variables defined in the CSV Data Set Config:

    enter image description here

This way each user will read next line from CSV file on each iteration and JMeter Variables placeholders will be replaced with the respective values fom the CSV file

Upvotes: 1

EdoCrippaOfficial
EdoCrippaOfficial

Reputation: 21

You can create a DataSet with all the user/password, maybe in a csv file.

Then, create a thread with the HTTPAuthorization Manager and the HTTP request, and repeat the thread. If you set the HTTPAuthorization Manager with one value, and the value is the variable from the DataSet, each iteration of the thread will take the next value of user/password

Something like this: enter image description here

Upvotes: 0

Related Questions