How to Use CSV File for Login Multiple Users through JMeter

Posted By : Nargis Khan | 29-Nov-2018


Introduction: JMeter is the open source tool and platform independent. JMeter is used for performance and load testing of a web application. Everyone is moved towards the web applications so the load is increasing day by day. Nowadays companies main focused is to give the best user experience to the end users. After developing the applications their main focus in on Load and performance testing. 


When we are performing performance testing with JMeter then we might face the issue of multiple user login with different Id’s.

i) When we record the API's and start load testing on the applications API then 1 user login multiple times in the app. Sometimes it creates a problem.

ii) When we add each page in the JMeter and if we increase the number of the thread count then it is also 1 user comes multiple times in the application.


Prerequisites: JMeter is installed in your system. And you also need to create the file of user inputs which you going to enter in the parameters. In my case, I have only one parameter which "passphrase" so I create a file and save with .csv extension.

Step1: Go to Jmeter and add the Thread Group. As you see in the image I have added the thread group first and give the number of counts is 10 because I have added 10 passphrases in my CSV file. Ramp-up count is 1 and time 1 second.

Step2: Add the Http Request Default for adding the common element like server name.
Step3: Add the Http Request sampler for the login page. Here I have changed the sampler name as login page and add the parameters. And select the method type and give the path of the login page as below image. 
Step4: Add the config Element as CSV Data ser config. Give the Path of the CSV file, variable name and add listener also as given image.
This below image is showing how I am saving my file in CSV format.
Result: Now you can see I am getting the positive response after running my thread group and also verify the that it takes passphrase sequentially.
Conclusion: It is very useful when you want to load/performance testing with a different set of data. when you are passing the parameter then parameter name and value should be correct and as same as to API parameter which is added by the developer at development time. 
Related Tags

About Author

Author Image
Nargis Khan

Nargis is certified in Manual Testing , she has done B.Tech in computer science. Her Hobbies are reading books & listening music.

Request for Proposal

Name is required

Comment is required

Sending message..