Jmeter Scenario: Users Login once - pause until all logged in and execute process (based on iterations not time) - processes complete users log out - jmeter

I'm relatively new to Jmeter but I have a scenario that I've not been able to figure out where I need to perform the following:
All user log in to application with a ramp-up period of 15 seconds between users.
No activity continues until all users log in to application.
Once all users are logged in, perform their set of business activities (will vary depending on business process, and based on iterations, not a time loop).
Once all users are complete business processes, users begin to logout with ramp-down time of 15 seconds between users.
Is this possible to configure my script to execute this way and if so, how? I have tried use of Once only controllers, loop controllers, constant timers, and some various plugins (Custom Thread Groups). I've also viewed various threads and not been able to find this exact scenario, but cannot imagine this is an overly unique test case...
Any recommendations or advice is appreciated.
Thanks!
This is highlighted in question above

Ramp-up period can be easily configured using "normal" Thread Group
To "wait" until all the users are logged in use Synchronizing Timer
Use Loop Controller to run the "business activities" as many times a you want
The same to wait until all the users finish executing their "business activities"
To implement ramp-down you can use JSR223 Timer and the following code:
return (ctx.getThreadNum() + 1) * 15000
where ctx stands for JMeterContext, see JavaDoc for all available functions and Top 8 JMeter Java Classes You Should Be Using with Groovy for more information on this and other JMeter API shorthands available for the JSR223 Test Elements.

Related

jmeter - I would like to know if it's possible to have login as part of the set up and logout as part of tear down for 250 concurrent users

I have scenario where I want to run load test for 250 users.
Ramp up time is 10 mins for 250 users and run test for 50 min duration.
Question 1 : Is it recommended to do login and login out as part of set and tear down .. as the dev team does not measure login and log out .?
Question 2 : How do i keep the the other thread group in loops during the 50 min duration . ?
I wouldn't go for it as normally different thread groups should represent the different groups of virtual users, setUp thread group is for accomplishing the pre-conditions for the test and tearDown thread group is for cleaning everything up. If you perform the login in the setup thread group - there will be negative consequences like having to pass login context (tokens, headers, cache, etc.) to other thread groups. So I would rather move login to be the integral part of the main thread group and if needed remove login/logout via Filter Results Tool (not part of vanilla JMeter, can be installed using JMeter Plugins Manager)
It can be done on either on Thread Group level like this:
or you can "loop" the arbitrary part of the test by putting it under the Runtime Controller:

How to count session/checkouts in jMeter

jMeter seems to be made to answer the question "how many parallel users can a server handle?"
That of course strongly depends on how fast the users browse the page.
What I would care about is "How many checkouts can the server handle per minute?"
So I've setup a click path that the users follow, from homepage to payment.
I slightly randomize click times (one click every 5-15 s), and use the plugin "jp#gc ultimate thread group" to step up the thread count every minute until the server fails.
What's the best way to get the highest number of checkouts per minute that was reached before the server died? Reporting seems to be all about concurrent users (threads), not taking thread restart i.e. new session into account.
There is Transactions per Second listener which plots throughput for JMeter's Samplers. If you're interested in the end-to-end business transaction - you can put all the associated Samplers under the Transaction Controller and tick both Generate Parent Sample and Include duration of timer and pre-post processors in generated sample so if you want to measure these "click times" duration of 5-15 seconds as well.
Transactions per Second listener can be installed using JMeter Plugins Manager

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.

Run Multiple requests of single thread group concurently

I want to simulate a scenario in which a page contains multiple requests for differ data. All runs concurrently. I created a Thread Group with all those requests and ran it for 10 users(Threads) in 0sec ramp up time. But in this Test Plan all users starts concurrent but they all process requests in sequential way i.e.(always completes first request then starts 2nd,then third,so on).
I want that all requests of each user starts at same time then completes according to their response time (Like if 3rd takes less time than first then it should complete before 1st and 2nd). I have tried Synchronize time.
I don't think it is possible at the moment, the relevant enhancement is being tracked as Bug 53159
In the mean time you have 2 options:
Use different Thread Groups to kick off the requests. If you need to synchronize the requests you can use i.e. Inter-Thread Communication plugin.
Develop some custom code using JSR223 Sampler or even create your custom sampler, see How to Load Test AJAX/XHR Enabled Sites With JMeter for details on how this can be done.

Simultaneous users for web load tests in JMeter?

I have made some PHP scripts and I want to test the response time for simultaneous users in JMeter. This scripts are run in a very short time (50 miliseconds).
What I would like to do is to simulate a load test from 1 to 50 of users where each user (thread) repeats the request for an unlimited period. So first we will have 1 user, after 2 simultaneous users, after 3 ... and so on.
I am trying to do it but with I have is response times where it is evident that there is no simultaneous request.
With HP loaddrunner we can define number of iterations for each thread, is this possible in JMeter?
You can possibly use these 2 thread group implementations
Stepping Thread Group
Ultimate Thread Group
from Jmeter Plugins package, that let you set load-increase for you scenario as you want.
As well you can also look onto Synchronizing Timer if you want "better" concurrency - but this is rather stress-testcase than load one.

Resources