jmeterperformance-testingthreadgroup

Jmeter How to use different user variables for each thread (each thread. not thread group)


I want to use 100 concurrent users in one thread group in Jmeter. but I want to each thread to use different user login password. how to achieve that?


Solution

  • full credit to Apache Jmeter documentation:

    Some test plans need to use different values for different users/threads. For example, you might want to test a sequence that requires a unique login for each user. This is easy to achieve with the facilities provided by JMeter.

    For example:

    Create a text file containing the user names and passwords, separated by commas. Put this in the same directory as your test plan. Add a CSV DataSet configuration element to the test plan. Name the variables USER and PASS. Replace the login name with ${USER} and the password with ${PASS} on the appropriate samplers The CSV Data Set element will read a new line for each thread.

    UPDATE documentation link

    https://jmeter.apache.org/usermanual/best-practices.html