I'm executing the JMeter load test with 5 users, 1 hours duration. If my 5 users operations will be completed in below 1 hours, Can it stop automatically. Do we have any option like this?
Just untick this Specify Thread lifetime box under the Thread Group:
and once last of your 5 threads (users) will finish executing its last Sampler your test will end
You can also untick the Infinite box next to the "Loop Count" and your test will stop after completing all the iterations or after 3600 seconds, whatever comes the first:
See Getting Started with JMeter - A Basic Tutorial for essential information on how to build your first web test plan with JMeter
Related
I need to run a load test of 25 threads, what will be the most efficient configuration to use? (ramp-up period....). I ran the load test with the below configuration and some of the threads failed but pass if I just ran the script individually.
Your configuration will mean that:
JMeter start with 1 thread and add another thread each 4 seconds
Once started each thread will begin to execute Samplers upside down (or according to the logic controllers)
When the thread executes the last sampler it will be shut down
When the last thread executes the last sampler the test ends
Depending on the number of samplers and application response time you may or may not achieve 25 users concurrency, you might want to check the actual number of concurrent users using Active Threads Over Time listener
If you want to make sure to have 25 online users set "Loop Count" to Infinite and "Specify Thread Lifetime" duration to be more than your ramp-up period. See JMeter Test Results: Why the Actual Users Number is Lower than Expected article for more details.
With regards to the failures - we cannot state anything meaningful without seeing request and response details, make sure to save them using i.e. View Results Tree listener and inspect response body for the failed requests
I am doing volume testing for an application for which I have to prepare a lot of a data using a jmeter script. So I want to automate the script so that it runs for a period of time specified.
My Testplan contains 10 Thread Groups:
ThreadGroup 1
ThreadGroup 2
ThreadGroup 3
.
.
.
ThreadGroup 10
What I have been trying is that I want my ThreadGroup 1 to run for 1st 30 minutes, then ThreadGroup 2 runs for next 30 minutes and so on till ThreadGroup 10 runs for last 30 minutes.
How can I achieve this configuration using scheduler in jmeter?
Any help would be appreciated.
Tick Run Thread Groups consecutively box in the Test Plan
In each of your Thread Groups specify "Duration" of 1800 seconds, Also make sure you have "Loop Count" set to Forever or -1 otherwise Thread Group will execute only this number of loops which is defined (by default 1)
This way your Thread Groups will run one-by-one and each Thread Group will last for 30 minutes.
Check out Getting Started with JMeter - A Basic Tutorial to get familiarized with JMeter essential components
My test is configured like below.
Thread group is configured to run for 9600s which is 160 mins that is 2 hours 50 mins.
within that I have placed constant timer as 1800000(ms) as that parameter is to be provided in ms. when I start the test, it stops within 4 mins and I can see in log that:
Stop test detected by thread:...
Is there any limit for constant timer, I.E. what could be the reason my test is stopping after 4 mins ?
There is no such limitation on Constant Timer. The error could be because of some other reason.
Share the error message and other configuration details in Thread Group. Also share View Results Tree screen shot after running the test
Note: Test will stop automatically if Jmeter completes with script execution irrespective of the time mentioned in scheduler. so, you should provide enough loop count (or mark forever), so that test would run till the scheduled time completes.
So I have a thread group set to run for 30 seconds with simple HTTP sampler. Basically the test just sends a GET request to HTTP server for 30 seconds.
Is it possible to have the same test restart again once it has finished based on a predetermined amount of times. So say i want the test to rerun itself 5 times...
Option 1:
It is possible with Run Time Controller.
I assume you have set the 30 seconds duration in the Thread Group scheduler.
Change the test plan as given below.
Thread Group - loop count should be 5 (no of times should be repeated)
Add a Run time controller - seconds should be 30
Move all the samplers, other controllers (whatever you had under the Thread Group) under the Run time controller.
Now this setup will the run the test 5 times - for 30 seconds each time.
Option 2:
You can use a bat/sh file to rerun the same test again and again in a loop if you are running the test in Non-GUI mode.
I have to test ramping up 1 user every minute for 10 minutes and then then ramping up 20 users ever minutes for next 10 minutes with jmeter. I tried to search on internet, seems like I need to use ultimate thread? If so can someone please give me an example of above scenario?
You can use multiple regular thread groups and in Test Plan,you can select Run thread Group consecutively.
Ultimate Thread plugin allows fine grained control of user threads. It will certainly achieve the concurrency pattern you're looking for. You can also start a thread group delayed with just out-of-the-box Jmeter though:
Use 2 thread groups, and set the required ramp up rates for each thread group. Since you need the second thread group to kick in 10 minutes after the test starts, add a startup delay of 600 seconds.
The relevant jmeter documentation is in Section 4.1 here:
Version 1.9 introduces a test run scheduler. Click the checkbox at the bottom of the Thread Group panel to reveal extra fields in which you can enter the start and end times of the run. When the test is started, JMeter will wait if necessary until the start-time has been reached. At the end of each cycle, JMeter checks if the end-time has been reached, and if so, the run is stopped, otherwise the test is allowed to continue until the iteration limit is reached.
Alternatively, one can use the relative delay and duration fields. Note that delay overrides start-time, and duration over-rides end-time.
It is possible to do with 1 ultimate thread group.
Your setup should be as given below. You did not mention the test duration. I assumed it as 3600 seconds.
1st Row : We will have 10 threads in 600 seconds by starting a thread every min.
2nd Row: We will have additional 200 threads (ignoring the first 10 threads), in the next 600 seconds by starting 20 threads every 1 min.
We need a wait for 600 seconds in the second row which is update in Initial Delay field for the first row to complete.