Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

multiple user logins in jmeter

Tags:

testing

jmeter

I am using jmeter to test a php application. I need to create a different thread with a unique session for each user. Because in my application you can only have one login per user at a time so putting 100 times the same user I will not get to any conclusion. I have created 40 users user0,user1....user39 with the same password is there a way to automatically create simultaneous threads for each of them?

Thanks

like image 500
Catalin Marin Avatar asked Apr 11 '11 15:04

Catalin Marin


People also ask

How many users can JMeter handle?

In conclusion, we can say that you can simulate up to 10,000 users on a JMeter load test even on a regular laptop. This depends on following 4 simple rules: Use JMeter listeners for debugging purposes only. Run JMeter performance tests in non-GUI mode.

How do I give login credentials in JMeter?

3.2. If we want JMeter to encode our credentials for us, we can use the JSR223 PreProcessor component. We'll need to use this if we want to vary the credentials used by our test plan. And we're done! Everything should work fine, and we're able to change the credentials easily in our user-defined variables.

What is the max user load or threads JMeter can handle?

JMeter allows you to run multiple processes in the same box, and it's usually pretty reliable generating up to 200 threads per JMeter instance. If you need more than that, I'd recommend using multiple JMeter instances. A modern machine with some tweaking can easily generate 500 to 1000 threads.

How do I run parallel requests in JMeter?

Open menu Options -> Plugins Manager. Install Parallel Controller & Sampler plugin. Add the Parallel Controller to the Test Plan: Right click on Thread Group -> Add -> Logic Controller -> bzm – Parallel Controller. Add your request samplers inside Parallel Controller.


1 Answers

I just implemented this using jmeter for an app that uses Spring Security (It would be very similar to PHP). This is fairly straightforward, basically:

1) Create a new CSV file using a text editor Ex: CSVSample_user.csv

   username1, password1    username2, password2 

2) In jmeter, create a CSV Data Set Config element

  Thread Group>add>Config Element>CSV Data Set Config   => Assign variable names (see image) 

3) Create an HTTP Request element

  Thread Group>add>Sampler>HTTP Request   => Create a POST with parameters, have the variable you created       put the values for the parameter. (See bottom image). 


NOTE: There are other elements you need, such as cookie manager, etc. Also number of threads needs to be set to the number of login users.

enter image description here

like image 72
ibaralf Avatar answered Sep 28 '22 01:09

ibaralf