My requirement is like this:
1. Run one full round of test using jmeter
2. Wait for 90 secs
3. Restart step1
4. I have to continue step1 and this entire process continues for 4 days.
Can someone help me how to add the delay after all the threads have been executed
Create a thread group with 1 thread with a loop count of forever and and click "scheduler". Set a start time and end time.
Put your tests within the thread.
Add a constant timer after the last test (still within the thread group though) and within thread delay, use 90000. (This converts to 90 seconds)
Related
I have 8 threads in JMeter, which i am executing for every 5 minutes using Task scheduler.
Now i have included 2 threads which want to run for 5 times per day only (ex: at 12am, 5am,10am...)
when the moment comes, the execution shall be 8+2 & remaining time, it shall be only 8 threads.
Is it possible to configure such usecase in Jmeter..
If you're going to use the same .jmx script and want to execute either 8 or 10 "threads" (whatever it is), you can go for:
If Controller - for conditional execution of this or that test elements
__groovy() function to check current time, an example condition which trigger the test at i.e. 5 AM would be:
${__groovy(Calendar.getInstance().get(Calendar.HOUR_OF_DAY) == 5 && Calendar.getInstance().get(Calendar.MINUTE) == 0,)}
Can you help me to explain relationship between time in Runtime Controller and Ramp_up period value of Thread group?
I tested
Number of Thread: 1
Ramp_Up Period: 1
Loop count: 1
Runtime Controller: 5s
->Elapsed time of current running test: 5s
But with case
Number of Thread: 5
Ramp_Up Period: 5
Loop count: 1
Runtime Controller: 5s
->Elapsed time of current running test: 10s
I don't understand why it become 10s.
Could you help me to explain more?
Ramp up is the time to execute all threads, runtime is controlling each thread execution.
In your case, ramp up 5 seconds means last thread will be executed after 5 seconds. Last thread will enter runtime controller which will run 5 seconds of execution. Thus 10 seconds is the maximum of your execution.
Runtime Controller acts according to JMeter Scoping Rules so it defines how long its children are allowed to run.
Normally you should be using it in conjunction with Loop Count = Forever or -1 on either Thread Group or Loop Controller level.
So
if you want the whole test to run for 5 seconds - use "Scheduler" section of the Thread Group
if you want only certain sampler(s) to run for 5 seconds - put them under the Runtime Controller, however the whole test duration will depend on when the last sampler enters the Runtime Controller
Also be aware that JMeter "asks" threads to stop so it might take some extra time to let them gracefully shut down.
Here I have 4 Thread Groups present in my Test Plan and I have a requirement, need to run test plan in the time interval of 30 minutes between each of my Thread Group (2nd thread group should start only after 30 minutes, after the completion of 1st thread group and so on).
But cannot estimate the actual duration for all my thread groups. And my Ramp-up period should be 0 for all my thread groups, is there any solution to full fill my requirement ?
Thanks in advance
Add Test Action Sampler to the end of each Thread Group
Configure it as follows:
Target: Current Thread
Action: Pause
Duration: 1800000
Add a Synchronizing Timer as a child of the Test Action sampler and set Number of Simultaneous Users to Group by to be equal to number of threads in the current Thread Group
This way Test Action sampler will act as a "rendezvous point" so all threads in the current Thread Group will sleep for 1800000 milliseconds (1800 seconds == 30 minutes), this way you will get a 30 minutes delay between Thread Groups.
Adding to #Dmitri T answer, Make sure in Test Plan the uncheck Run Thread Groups Consecutively so it won't try to execute in parallel
You can add Critical Section Controller in each Thread Group as the parent of all other components with same name (default is global_lock)
That way no Thread Group will start until previous thread ends.
EDIT
For getting result between threads:
Add to each thread group Generate Summary Results to get the result of each thread
Generates a summary of the test run so far to the log file and/or standard output.
I use like this :
Add "Flow Control Action" steps in Sampler List to the end of the Thread Groups
I am doing Jmeter testing. My setup is:
thread group: 1
threads in group: 10
loop count: 5
I also have a csv data config file that contains:
usr1, passwd1
usr2, passwd2
usr3, passwd3
usr4, passwd4
usr5, passwd5
'Recycle on EOF' set to true, 'Stop Thread on EOF' set to false.
Then I read some article online (JMeter CSV Dataset Config: how to move through variables in the same thread?)
A couple of doubts:
I think by setting 'Recycle on EOF' set to true, thread 1-5 will use username/passwd 1-5, thread 6-10 should reuse username/passwd 1-5. But I am wrong, thread 6-10 only get EOF as username/passwd and fail my test obviously, like the article suggest. But why?
Then I set 'threads in group' to 5, problem in 1) is gone, thread 1-5 use username/passwd 1-5 for loop 1. But because loop count>1, I do not know when thread 1-5 finish their 1st round, what username/passwd they will pick for loop 2? Should thread 1-5 still use username/passwd 1-5 in that order always? My observation is that it's like a first come, first served thing, whichever thread finish loop 1 first will get username/passwd 1. Is that the expected behavior?
For some reason, my test does not allow 2 threads to run using the same username/passwd at the same time. If what I describe in 2) is true, then I can have below timing situation:
a) thread 1 (use username/passwd 1)takes longest time
b) thread 5 (use username/passwd 5)takes shortest time
c) when thread 5 finish loop 1, it grab username/passwd 1 and run, at this moment, thread 1 loop 1 is still in progress, bad things happen...
So what configuration can I set to have all threads to wait for each other to finish the current loop, then start to run next loop together?
Running a recorded test plan. I have assigned in Thread Group for No of users is 25, Ramp-up period is 25 and Loop Count is 1.
a).Start the test.
b).While the test is running in the upper right-hand corner, the number gets increment 1 by 1 until 9/25. At some level, the number remains constant 9/25 and then shows 8/25. After some time, the number automatically gets decrements by 1, 7/25....0/25.
c). In Database also, i seen the login entry only 9 users.
why my test plan not gets succeeded for the 25 users ? Please suggest me ?
This is because - your test seems to be only 9 seconds long. ie. after 9th second, by the time the 10th thread is created, first thread finishes its execution. so it shows the concurrent user load on the server remains 9.
Remember that each thread/user is executed independently.
Lets assume - your recorded test plan takes 5 seconds to complete for an user/thread.
So, in your case,
second 1: user/thread 1 gets created & execution starts
second 2: user/thread 1 execution in-progress, user/thread 2 gets created & execution starts
second 3: user/thread 1 & 2 execution in-progress, user/thread 3 gets created & execution starts
second 4: user/thread 1,2 & 3 execution in-progress, user/thread 4 gets created & execution starts
second 5: user/thread 1,2,3 & 4 execution in-progress, user/thread 5 gets created & execution starts
second 6: user/thread 1 finished execution (5 seconds). user/thread 2,3,4 & 5 in progress. user/thread 6 gets created & execution starts
If you see, after 6th second, concurrent thread will be 5 because thread 1 already finished its execution.
If you need to see all the 25 users in 25 seconds (25/25) - then your test be taking more than 25 seconds.
(from your question - looks like your test is only 9 seconds long. so you can not expect 25 / 25 with 1 loop count)
Do the following:
Click the checkbox 'Forever' in the Loop count
Click the checkbox 'Scheduler'
Set the duration 60 seconds.
Run the test now - you will see 25 users in 25 seconds - the test will stop after 60 seconds. Scheduler will keep threads execute continuously for 60 seconds.
Hope it is clear.
25 users in thread group doesn't always mean that you'll be having 25 concurrent requests.
There are several options on how you can implement your load scenario:
Ultimate Thread Group (available via JMeter Plugins) lets you specify number of users to start with, ramp up period, time to hold the load, ramp down period, etc. It looks like to be the easiest option to proceed with.
Synchronizing Timer - to release all threads at the same time, i.e. 25 requests at the same moment.
Constant Throughput Timer - to set the desired load, i.e. 25 requests per second.