difference between concurrent user vs active Thread in jmeter - jmeter

Please explain the difference between concurrent user vs active Thread. Is both are same or have any differences in both.

In JMeter world a thread is a virtual user so ideally the number of active threads should be equal to the number of concurrent users.
Just keep in mind that you need to properly simulate the real user by the virtual user to wit:
Add HTTP Cookie Manager to represent browser cookies
Configure HTTP Request Defaults to download embedded resources and use concurrent pool of 6 threads for doing this
Add HTTP Cache Manager to simulate browser's cache
Add HTTP Header Manager to simulate the browser's headers
Add Timers to simulate "think times" (real users need some time to think between operations, type something into inputs, read text, etc.)
More information: How to make JMeter behave more like a real browser

Related

Is there any way to do performance testing on website built on react js using Jmeter without selenium integration?

I want to perform load test on website built on react js with 500 users.
Is it possible with jmeter without selenium plugin?
You can create JMeter test plans and simulate the 500 concurrent users accessing the system.
Record the test script
Correlate the session variables
Add timers
Configure the thread group
Run the test
There are a number of ways to build a JMeter test plan. You can use HTTPS Test Script Recorder or Blazemeter Chrome Extension to record the steps. Then you will have to add timers, correlate the sessions with the JMeter post-processors, etc to simulate the real users.
Ten ways to build your JMeter test plans
In your Thread Group set the Number of Threads (users) to 500 to simulate 500 concurrent users. Add a ramp-up time (e.g 60 seconds).
Note: Timers will simulate the think time of the users or the delays between the requests. You may use Random Timers to simulate different think times.
It is, JMeter doesn't know/care anything about the system under test technology so as long as JMeter supports network protocols used by the application it should be able to replicate the network footprint of the real browser.
Browsers in their turn don't do any magic, they send HTTP requests, wait for responses and render the response in the browser window.
JMeter is capable of sending HTTP requests via HTTP Request sampler so it can load test web applications, including but not limited to react js ones.
Just don't forget to configure JMeter to behave like a real browser:
Configure HTTP Request samplers to retrieve embedded resources (images, scripts, styles, fonts, etc.) from web pages
Use HTTP Cache Manager to simulate browser cache
Use HTTP Cookie Manager to simulate browser cookies
Use HTTP Header Manager to simulate browser headers
Use Timers to simulate real user "think times" (real users don't hammer the website non-stop, they need some time to "think" between operations, read something, type something, etc.)

Jmeter load testing for login

I want to test how many users can concurrently login to the application. For that, can I create one user name and password and increase the thread to 100? or should I create 100 username and passwords and load it somehow?
Treat each JMeter thread (virtual user) as the real user using a real browser, it means:
Different credentials (can be provided via CSV Data Set Config)
Properly simulating browser network footprint including (but not limited to)
Sending and receiving headers (and cookies as special header sub-type)
Downloading embedded resources (images, scripts, styles, fonts, sounds)
Representing browser cache
Simulating AJAX requests
Mimicking real user "think time" as real users don't hammer application non-stop, they need some time to "think" between operations so consider adding appropriate Timers
Login itself won't tell you full story, you need to produce realistic workload, i.e. after logging in user should start doing something which he's normally doing
Usually concurrent users = different users, because it should be based on real case scenario
During a load test you try to emulate real-world conditions
If you want to have concurrent users in your application you should use different users because most servers won't allow same user to use your application with multiple sessions, also your application wants to (test) support multiple users so you need to load test the common scenario first.
If your application allows user to use your application with multiple sessions
, then add a second load test which test it also

jmeter active threads and csv - is this setup correct

I am using jMeter to load test logging in and logging out of my application. I have a CSV with 500 uname and pwords, and I have also set the active threads to 500.
Is this the correct way to stimulate a load of 500 users?
From technical perspective - yes, JMeter will pick up credentials from CSV and send them along with the request.
However if you think about what happens in reality logging in and immediately logging out doesn't seem a realistic use case for me. The whole idea of load testing a web application is simulating real users as close as possible, it includes:
Application usage scenario(s): how many users will be accessing your application at the same time and what users will be doing what things? For example given Stack OverFlow the vast majority of users are searching for answers by given criteria, some users are typing questions, some of them providing answers, and some of them are commenting. These all are different behavioral patterns which need to be accurately simulated by your load test
Each user should have a "user session" which identifies him so application would distinguish different users so make sure you have HTTP Cookie Manager in your Test Plan
Real users use real browsers which are downloading images, CSS and JavaScript files using parallel thread pool (around 5 concurrent threads) to speed up page loading process. In order to mimic this behavior you need to configure HTTP Request samplers to download embedded resources and do it in parallel. You can apply this configuration to all the HTTP Request samplers via HTTP Request Defaults.
Don't forget to add HTTP Cache Manager to mimic browser cache as real browsers normally cache embedded resources to disk and don't re-request them on subsequent calls.
So I would recommend reviewing your test scenario and/or load pattern and get familiarized with How to make JMeter behave more like a real browser article

JMETER user based or throughput based testing

I want to know how much users the system I am testing can handle and I am confused which test to use in JMeter, user-based where I user specific number of threads or throughput based where I use the throughput timer and from there I calculate the number of concurrent users.
You have answered your question yourself, if you need to know how many users your system is able to handle you need to simulate real users as close as possible, it includes:
Cookies (HTTP Cookie Manager)
Cache (HTTP Cache Manager)
Headers (HTTP Header Manager)
Think Time (Timers)
Your application usage scenarios (user groups distributions)
Start with one and gradually increase the load until response time will start exceeding acceptable or errors start occurring, whatever comes the first.
See How To Make JMeter Behave More Like A Real Browser article for more information on above hints.

Multiple Instances of Firefox need to be invoked through web driver sampler of Jmeter

I have created a Thread Group which has Firefox Driver Config , a Web driver Sampler and a View Results Tree Listener.
I have also added CSV Data set Config and passing username and Passwords through it to the application.
I have around 10 Credentials.
The scenario i want to do is, I want all the 10 users to login at the same time i.e 10 instances of the firefox browser to be invoked and do the job. i have given 10 in the thread group, but the users login 1 after the other.
Basically i am doing a performance testing, So i need all the 10 users to login at the same time(Simultaneously). So that 10 instances of firefox can be invoked at the same time.
Can anyone tell me, how can i achieve this in Jmeter?
Just add Synchronizing Timer to your test plan, if you need to test simultaneous login - put the timer as a child of login webdriver sampler.
I assume that you aware of recommendations from WebDriver Sampler Tutorial like
It is NOT the intention of this project to replace the HTTP Samplers included in JMeter. Rather it is meant to compliment them by measuring the end user load time.
and
JMeter allows the creation of multiple threads, and each thread is responsible for creating load on the server. However, for the Web Driver use case, the reader should be prudent in the number of threads they will create as each thread will have a single browser instance associated with it. Each browser consumes a significant amount of resources, and a limit should be placed on how many browsers the reader should create.
So it is recommended to create main load using JMeter's HTTP Request samplers and using one thread executing WebDriver Sampler to measure real-life user experience. If you still intend to create the main load with the WebDriver Sampler remember that browsers are resource-intensive so you'll need to provide something like 1 core and 1 Gb of RAM to each browser instance so make sure that machine(s) running JMeter have some capacity.

Resources