Jmeter load distribution using single thread group - jmeter

I have a single thread group for 100 users and I need to distribute the load as below 100 users will navigate to login>> homepage. After that 60 users navigate to buy shoes and the remaining 40 users will check their balance and 100 users log out. How can we achieve this in JMeter?
I am trying If controller to achieve this but cannot do so.

Take a look at Throughput Controller, it allows you to specify either percentage or exact number of executions of its children.
If you will have more distribution options Weighted Switch Controller might be a more convenient option:
The Weighted Switch Controller can be installed using JMeter Plugins Manager

Related

JMeter understand Thread Group / Throughput and INCLUDE

I have a few question to clarify on my understanding of how JMeter works.
a. Thread Group determine the number of users but it does not determine how many HTML requests are generated per sec ? By default, I notice that every user will send a HTML request at a rate of 2 RPS.
b. If I want to change the RPS per user, then I need to use the Through Put Timer. But the Timer can only lower the request rate from 2 RPS to a lower number. It does not increase the RPS.
c. In order to increase the RPS, I need to add more Threads.
d. Does this mean we are limited to 2 RPS per user ? I see some website have links to many other websites so a webpage refresh would make many requests.
Is this the way JMeter works ?
I have a load test which has 8 transaction (eg CRUD,...). I intend to create a overall Test Plan and I want to use INCLUDE to add all the 8 txn. Do I just record the website and INCLUDE ? What should I include, only the HTML requests ?
I'm also thinking of adding Think Time and Add Variables in the 8 scripts before I INCLUDE.
Do I add the Config Element (eg CSV Dataset Config) in the 8 scripts or the overall Test Plan ?
Thanks.
By default each JMeter thread (virtual user) executes requests as fast as it can. If you want to slow JMeter down to mimic a real user which doesn't hammer the server non-stop and needs some time to "think" between operations - use Timers. More information: How do I Correlate the Number of (Concurrent) Users with Hits Per Second
If you want more RPS - add more threads (assuming that the system under test can give you more RPS)
You should INCLUDE everything which is related to your website (images, scripts, styles, fonts, sounds, etc.) but in the same manner as your browser does, i.e. don't record these requests and instead configure JMeter to download embedded resources and use HTTP Cache Manager so JMeter would request these resources just like browser does. Any requests to "external" websites should be excluded (unless they're also developed and supported and in scope for testing)
That's a good approach, if you use a value more than once it makes sense to declare it via User Defined Variables so you would be able to amend the value only in one place
You add it according to your scenarios, be informed about JMeter Scoping Rules

How to collaborate Jmeter Load Test Scenario

Scenario - System should able to handle 1000 simultaneous users logged-in, and 500 users also active at the same time in the system.
Normally you should use different Thread Groups for representing different groups of business users so just add 2 Thread Groups, one with 1000 "logged-in" users and another one with 500 users which are "active" (whatever it means).
Then add HTTP Request samplers to implement your users activities (you can even record and replay the test scenarios using HTTP(S) Test Script Recorder)
If you already have implemented these user flows and just want to divide 1500 users into 1000 and 500 doing different actions within the bounds of the singe Thread Group- put them under 2 Throughput Controllers
More information: Running JMeter Samplers with Defined Percentage Probability

How to randomize website test using jmeter?

I want to test multiple scenarios in a same website using JMeter.
For example I have 2 thread users.
I want..
>1st user performing 1st scenario: like login his account
>2nd user performing 2nd scenario: browse some other page
How this can be achieved in JMeter?
If you need 50% of users to perform login and 50% of users to browse the website there are following options available:
Use 2 separate Thread Groups:
Thread Group 1: with virtual users who perform login
Thread Group 2: with virtual users who perform browsing
Use Throughput Controller like:
Add Throughput Controller configured like:
Percent Executions
50.0
Add the relevant sampler(s) under the Throughput Controller (as child)
Do the same for 2nd, etc. scenarios
See Running JMeter Samplers with Defined Percentage Probability article for more detailed explanation of above and more complex distribution scenarios.

jmeter calculate page load time, the which type of thread to be used to observe the maximum load in which server is stable

I am new to jmeter and scripted for login authentication. Project requirement is to see the load for 10K concurrent users.
Script is working fine but to enhance I need suggestions on how to do the following thigs:
How can I see that how much time/average time the server takes to load a page.
which thread grp (studied Ultimate thread group but it is not very clear to me), should be used to see the maximum load the server can sustain in a particular time, for that rampup time need to be adjusted (correct me if I am wrong).
Please tell how to adjust the rampup time with respect to users/waiting time etc., in short how to do incremental/proportional observation to see the server performance(there is no Gateway error etc)
If you're looking for your server capacity boundaries I would rather stick to "requests per second" rather than to "concurrent users" as users may work with different applications in a different way.
For instance, if it is image gallery - the majority of users will be browsing images and do this rather frequently, for instance request next image i.e. each 2 seconds. Given image load time 1 second it will be an image per 3 seconds - 20 images per minute. In this case 10000 users will create the load of 3333 requests per second.
If your site is articles collection, users will need some more time to read an article, i.e. 2 minutes. In that case 10000 users will create 83 requests per second load.
JMeter provides Constant Throughput Timer out of the box, you can set desired target throughput in requests per minute using it. And once you're already aware of JMeter Plugins project, it offers Throughput Shaping Timer - more advanced test element with extended functionality.
If you go "throughput" way, no matter which Thread Group you choose as the load will be orchestrated by aforementioned timers.
See What is the Relationship Between Users and Hits Per Second? article for more detailed explanation.
Once you design your test scenario run it in non-GUI mode (as JMeter's GUI is very resource intensive) as:
jmeter -n -t /path/to/your/testplan.jmx -l /path/to/resultsfile.jtl.
When the test finishes, open JMeter GUI, add Aggregate Report listener and inspect min/max/average response times per requests.

Define a group of requests in order to obtain a total time in Jmeter

I would like to know if there is anyway to create a group of HTTP requests in order to obtain the total time of a request ?
Let me to explain better when i start a login process several resources are loaded since i don't know how to group this login process i have to make a sum of all this resources in order to obtain the waiting time to finish the login. In one user is easy but since i'm testing 1000 user simultaneous it became impossible.
( i want to create a graphic using the number of user vs time of waiting )
best regards.
Use Transaction Controller as parent of those requests that you need to group together.
To produce graph I suggest you use JMeter Plugins and their Ultimate Thread Group to better control number of users and to show results use Composite Graph in which you'll show number of users and response time.
If you don't want time component you can use Response times vs Threads. It'll show you number of users on X and response time on Y axis.

Resources