I am new to JMeter. I want to run a 200 concurrent user load on my website with 50 users on different page. Do I need to create multiple thread groups with 50 users each or can I do it in the same thread group.
You can do it with one thread group using Throughput Controller
Related
Due to the limitation of Test Users Ids, we were only running the test with 3 Test Ids, these Test Ids can have max 1 session, if we login manually on another browser or machine it will kill the existing session.
Based on this limitation, I used Setup Thread Group to login, Teardown Thread Group for Logout and Thread group where I searched a few Items. On this Thread Group, I was successfully able to execute 20 users Load test where users were searching items and I was able to achieve the throughput target, even though the users' login session was 3, but problems occurred after 20 min of test when a session of Test user ids expire and Thread Group starting giving error.
My requirement is to run a load test for 1 hr with 20 user load on Thread Group, is it possible to recall setup Thread group so that I can achieve my requirement or if you have any other approach please suggest.
Theoretically it's possible to use Inter-Thread Communication Plugin to conditionally call something in another Thread Group, but I don't think setUp Thread Group is a good candidate because it's executed before the main Thread Group.
It worth switching to "normal" Thread Group and the easiest solution would be just letting it run continuously and re-login each 19 minutes so the session would be "refreshed", the delay can be introduced using Constant Timer of Flow Control Action sampler.
In the main Thread Group you can either introduce some "Startup delay" in order to let the first Thread Group to login:
or use the aforementioned Inter-Thread Communication Plugin if you need to start main threads right after logging in without any extra delay
I'm testing a web application that only allow 5 active sessions. I want to simulate 100 concurrent REST API calls. But the below script doesn't work.
Jmeter script
Is it possible to simulate Once Only login but 100 concurrent users with JMeter?
You don't seem to be understanding what does Once Only Controller do.
It runs its child(ren) during only first iteration of the Thread Group, it doesn't execute them at the same time.
If you want to run 100 requests at the same moment - take a look at Synchronizing Timer
If in your setup 5 requests are successful and other 95 are failing you could consider logging in somewhere in setUp Thread Group and then pass the JMeter Variables holding the authentication context to the main Thread Group so all 100 threads would share the same login details.
My case is-
I have to login in a website and then have to fecth a data.
For that I have created one thread group and created two HTTP request , one for login and one to fetch data.
But I want login HTTP request to HIt one time and data fetching to hit for many Virtual users.
But There is one common thread group for both.
Please help How I can sort out this?
If you need to run all requests after login in parallel, you may use Parallel Controller plugin:
Install JMeter Plugin Manager: Download plugins-manager.jar and put it into lib/ext directory, then restart 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.
Choose your Thread Group and set the number of threads (users) and loop count.
Each thread will execute the test plan in its entirety and completely independently of other test threads. Multiple threads are used to simulate concurrent connections to your server application.
So, if you want to run login sampler just once, set:
Number of Threads (users) to 1
Loop Count to 1
There are also different types of Thread Groups. Check official documentation for more information
JMeter threads (virtual users) are totally independent from each other, they use Thread Local Storage pattern for storing session information and variables therefore if you login with one user - it will be able to fetch the data, the second user will not be able to fetch the data if he isn't logged in.
If you're absolutely sure that you want to share the same login session across multiple virtual users and perform login only once consider the following test setup:
setUp Thread Group with 1 virtual user and 1 loop to perform login
Inter-Thread Communication Plugin to store the session information (i.e. Cookies) and pass it to the normal Thread Group
Normal Thread Group with as many users as you need using the data from the setUp Thread Group
Check out SynchronizationPluginsExample.jmx test plan for reference implementation.
I need to perform the task to include the following scenerio :
2 different admin edit the same customer profile concurrently
What shall i be doing to configure this concurrent testing .
I have made Login thread Group where i used CSV config element to have different login at same time . But i have kept header manager which extract the authentication token from the last login only and edit customer profile is done through the last logged in admin . How can i make 2 different users to edit the customer profile at the same time i.e concurrently ?
As per JMeter Documentation
Variables are local to a thread
So if you have 2 threads (virtual users) each of them will have its own authentication token (given you really have 2 admin accounts and use different credentials)
Also be aware that the only way to ensure concurrency in order to have requests occur at exactly the same moment is using Synchronizing Timer. If you don't use the timer - JMeter will be trying to send requests by each thread as fast as it can, it may lead to concurrent requests but you don't have any guarantee, especially when it comes to 2 users only.
Hi guys im newbee in JMeter. My load testing needs to test 200 users in 1hr only. But I want to start in 20 users only and add 20 users every 360 seconds until reach 200 users after 1 hr. How to do that in thread group?
The easiest way would be using Stepping Thread Group with the configuration like:
You can install Stepping Thread Group as a part of Custom Thread Groups bundle using JMeter Plugins Manager