Issue with throughput controller - jmeter

my thread count is 100 and iteration count is 100 .50 users are registred users and 50 users are guest users.
home page -5%: This page should run for 5 % total hit of both guest and logged in user irrespctive of user type.
Login page- 50% : This page run for 50% of total hit.
Search page 20%- This page should run for 20 % total hit- This can be run for guest as well as logged in user.
product page 15%- this page run for 15 % total hit-This can be run for guest as well as logged in user and this prequest is using parameters from search page(3rd request)
Add to cart 10%- This page should run for 10% of total hit- For performing this request i need to make sure that user is already logged in user and parameters are captured from search page reques(3 rd request)
I wan to create test plan for the above condition

For me, the question itself is not fully understandable.
As it not possible in single Thread Group to achieve the requirements, Following is the Test Plan you can try out to achieve the dependencies along with the percentage of distribution. This is NOT a correct solution but I claim it as a probable solution. You can customize as per your needs.
Test plan
...Thread Group (configure 100 users)
......HTTP Cookie Manager
......Throughput Controller (by percentage throughput - 5%, uncheck Per User checkbox)
.........Home Page (Transaction Controller)
......Throughput Controller (by percentage throughput- 20%, uncheck Per User checkbox)
............Search Page (Transaction Controller)
......Throughput Controller (by percentage throughput- 15%, uncheck Per User checkbox)
............Product Page (Transaction Controller)
......Throughput Controller (by percentage throughput- 50%, uncheck Per User checkbox)
.........Login page (Transaction Controller)
............Login Request (HTTP Sampler)
.........Throughput Controller (by percentage throughput- 20%, uncheck Per User checkbox)
............AddToCart (Transaction Controller)
......Aggregate Report
Important Notes:
Added Throughput Controllers as a parent of Transaction Controllers to control the percentages. Uncheck Per User checkbox.
Transaction Controller contains the HTTP Samplers. eg: Login Transaction contains all the HTTP Samplers that are responsible for Login operation.
Add Aggregate Report listener under Thread Group, to capture all the request results.
Image reference:

Related

Jmeter throughput controller actions run per iteration

I have the following scenario.
HTTP Cookie Manager - clear cookies after each iteration
Login http action -> 30%
Show profile (the user must be logged in) -> 20%
Purchase (the user must be logged in) -> 50%
The problem is, in presence of throughput controller there is no guarantee that per iteration the user will be logged in before any other action that requires the user to be logged in, so after any iteration the cookies will be cleared which means the session will be invalidated, there is a probability the the action will fail since no user logged in.
Taking into account the clear the cookies is a need.
If there is a way like per each iteration the login will be triggered once and the other actions will be repeated to target the throughput controller.
Is there any idea that is suitable for my scenario using jmeter?
Your scenario does not make a lot of sense as given the user needs to be logged in in order to perform Show profile and/or Purchase tasks you should perform login for 100% of users before viewing the profile or making the purchase. So I would recommend moving your Login http action outside the Throughput Controller like:
Login http action
Show profile
Throughput Controller
Purchase
Throughput Controller
Another option will be using Switch Controller, this way you will get confidence that each child test element will be executed at least once. Check out Running JMeter Samplers with Defined Percentage Probability article for more details.

How to control no. of requests per user in Jmeter

I am doing load testing for one ecommerce website. I am using Ultimate thread group.
Now I want to send per user only 1 request. So for ex: If 500 users then only 500 request should send. How can I achieve it using Ultimate thread group?
Why I want above because I am doing whole process like login, select product, add to cart and checkout. So it should do everything only once per user.
Your test design is a little bit flaky as given each user does login, select product, add to cart and checkout you will have at least 4 requests per user which gives 2000 requests in total (doesn't include embedded resources calls). You can use Transaction Controller to group these requests into one "workflow" however it won't limit actual amount of requests.
If you need to run your workflow by each user only once you may run into a situation when either load will be less than 500 concurrent users or test duration will be less than 30/60 minutes, see JMeter Test Results: Why the Actual Users Number is Lower than Expected
If you add more iterations each user will be executing your workflow more than once
Normally web test plan should look as follows:
Given each user executes test scenario steps and acting like a real user
Gradually increase the number of users unless application response time becomes too high or errors start occurring, whatever comes the first
Analyze results, identify the bottleneck, report your findings
Lets say the duration of the test is 1 hour. First user completes the workflow you had mentioned in the first 10 mins itself. What should happen after the workflow for the user? Should the thread be idle for the remaining 50 mins?
I think you should use the regular Thread Group with 500 threads and loop count as 1. Ultimate Thread Group is for duration based tests. You could use Once Only Controller as a workaround inside to do the action only once for the user. But it is an ugly approach.
You can use Throughput Controller.
The Throughput Controller allows the user to control how often it is executed. There are two modes:
percent execution
total executions
Percent executions
causes the controller to execute a certain percentage of the iterations through the test plan.
Total executions
causes the controller to stop executing after a certain number of executions have occurred.
Like the Once Only Controller, this setting is reset when a parent Loop Controller restarts.

Jmeter concurrent user load Test Plan

I am new to Jmeter. My project Manager said to me to test the website load with 100 concurrent user.
Following functionality of website considering to load test-
User Registration
Get Registration Page Request
Post Registration Page Request
Login and User profile navigation
Get Login Page request
Post Login page request
Get User Dashboard request
Get edit Profile page request
Get change password request
Get Invite Friend Page request
My Test Scenario is 50 concurrent user Accessing Registration page and other 50 concurrent user accessing User profile(login,dashboard, etc) .
I have created following test plan for the same -
And did thread configurations for registration and Login same as -
Total No of Threads : 50
Rampup period : 600 sec
Duration of holding load : 3600 sec
Configured constant timer (delay for each request 200 ms) for both Thread Group requests also added some listeners for collecting the result. I have following question -
Is it correct way to include these many request in test plan for complete load test of My website ?
Do I have configured right thread properties or what else I can do for achieve the best ?
Think Time
Your test plan looks good, however the current configuration doesn't represent 100 concurrent users as 200ms think time is something for "superhuman". Real users "think" for a longer period between operations and it should vary depending on the nature of simulated request. So I would suggest using individual Uniform Random Timers with the relevant think time ranges for each request.
Overall Test Design from the "reality" perspective
If you have some extra time you could think about bringing more reality into your simulation like:
X users perform registration
Y users editing their profiles
Z users inviting friends
etc.
So distribution would represent normal anticipated usage of your application. Your load test should be as realistic as possible, only this way you will be able to tell for sure "my application is able to support this many users providing reasonable response time". Take a look at Throughput Controller
Overall Performance
Disable Active Threads Over Time and especially View Results in Table listeners during test run
Configure PerfMon Metrics Collector listener to store the captured values into a file. Later you will be able to open the file and analyze the metrics
Run the test in non-GUI mode
follow other recommendations from 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure

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.

How to send multiple request at same time

I am testing a website for load test having following pages
Home Page
Login Page
Blog Page
Selected Blog Page
Post on Selected Blog
I want to send request for each page at same time with different number of users. At now i am doing this in following way
Thread 1 (user 500)
Home Page
Thread 2 (300 user)
Blog Page
Thread 3 (100 user)
Selected Blog Page
But when i use login functionality, then how can i achieve this task because login requests sets some cookies data and other information about user and Post page also need some data from Selected Blog Page.
I want to achieve following:
Lets suppose 500 user logged-in then 300 user should hit Blog Page, 100 user hit Selected Blog Page and 100 User hit the Post on the Blog Page , but all things should be at same time.
I see 2 ways with some assumptions,
Assumption : by saying Thread you mean Threadgroup and you have 3 threadgroups each with only 1 request i.e.
Threadgroup1
home Page
Threadgroup2
blog page
Threadgroup3
select blog
Options :
For each threadgroup you can make simultaneous load by making rampup time 0,delay 0. By doing this Jmeter will start all threads(users) at a time.
use Synchronization timer (standard way) : this will block no. of threads till a count is achieved and then releases all threads at once to generate heavy load at a given point of time.
Scenario 1 would be,
each threadgroup with reqd no of users and rampup 0
Scenario 2 would be,
single threadgroup with max no of users but before each req. synchronization timer which will wait for specific no. of users (100 for example). read help about synchronization timer.

Resources