jmeter run part of thread groups sequentually - jmeter

I've got quite complex jmeter test plan that prepares data and save pre-conditions to properties that next thread groups use. So I CANNOT disable "Run thread groups consecutively" and split this onto 2 different plans. But I need to emulate different users' behavior and those thread groups differ by Number of threads and queries.
Is there any way to launch selected thread groups sequentially without breaking preparation on a regular basis?

Will try to do that via setUp Thread Groups/ Thread Groups / TearDown Thread Groups and without Run consecutively

Related

jmeter ultimate thread group use same user on each iteration

I'm looking at doing spike tests and I think ultimate thread groups in Jmeter are the way, but I need Jmeter to keep the connections open during the test and use same user on each iteration like it does in regular thread groups, is there a way to force that in Ultimate thread groups as well?
If not, is there a way to do spike testing with regular thread groups in Jmeter?
I've tried setting the thread schedule to produce spikes in ultimate thread group but Jmeter continues to generate new connections per each request. In regular thread groups this can be solved by checking "Use same user on each iteration" but that check box is not present in Ultimate Thread Groups.
I can think of the following options:
Don't use Ultimate Thread Group, the "spike" can be implemented using normal Thread Group in combination with Synchronizing Timer
If you want to proceed with the Ultimate Thread Group you can add a Loop Controller to it and set the desired number of iterations there
More information: Stress Testing, Soak Testing and Spike Testing Best Practices with BlazeMeter

How do I maintain sessions between Thread Groups in JMeter

I have 5 thread groups (Ultimate Thread Group) in JMeter. When I run the entire test, the samples in the first thread group work fine, those in the second thread group invoke the web sites timeout page, but when the same samples (in the second thread group) are put in the first thread group and the test run, they work fine and do not invoke the timeout page. I realise that I need to pass the session from the first thread group to the other thread groups, please how do I do this?
The following is the cookie data:-
The following are the thread groups:-
If you need to pass data between different Thread Groups most probably your test is badly designed.
Each JMeter thread (virtual user) must represent a real user with all its stuff (Cookies, Cache, Headers, think times, etc). If these 5 business actions are a part of a single used workflow - they need to be put under the same thread group.
Use different thread groups to represent different groups of business users.
If you really need to pass cookies between thread groups it can be done using JSR223 Scripting or Inter-Thread Communication Plugin

JMeter Test Plan settings

I am new to JMeter. I'm using JMeter version 5.0.
I have created a new Test Plan. Test Plan has a few settings.
Can you please explain the use of each checkbox?
Checkboxes are:
1) Run ThreadGroups consecutively(i.e one at a time)
2) Run tearDown ThreadGroups after shutdown of main threads.
3) Functional test mode(i.e. save Response data and Sampler Data)
When trying to understand JMeter, go through its component reference (below)
You should keep the defaults unless specific case is needed.
Functional Testing is not recommended/needed unless you are debugging (and also not needed usually)
teardown/setup groups are useful for setting/cleaning tasks in test.
And usually you want run multiple Thread Groups serially rather than in parallel.
Selecting Functional Testing instructs JMeter to save the additional sample information - Response Data and Sampler Data - to all result files. This increases the resources needed to run a test, and may adversely impact JMeter performance. If more data is required for a particular sampler only, then add a Listener to it, and configure the fields as required.
The option does not affect CSV result files, which cannot currently store such information.
Also, an option exists here to instruct JMeter to run the Thread Group serially rather than in parallel.
Run tearDown Thread Groups after shutdown of main threads: if selected, the tearDown groups (if any) will be run after graceful shutdown of the main threads. The tearDown threads won't be run if the test is forcibly stopped.
1) Run ThreadGroups consecutively(i.e one at a time)
In a test plan usually, you would have different thread groups ( user groups ) sending requests to different services. For example
Thread Group 1 > Load and Login to the System
Thread Group 2 > A Form Submission in the System
Keeping the above-mentioned thread groups, if you have selected Run ThreadGroups consecutively option it will run The Thread group 1 first and then move to the second one. If not there will be a parallel execution of all active Thread groups.
2) Run tearDown ThreadGroups after shutdown of main threads
There is no difference in a normal Thread Group and a Teardown Thread Group when it comes to the functionality. You can specify the Post-Test actions in the Teardown Thread Group and use Run tearDown ThreadGroups after shutdown of main threads to execute them after the normal thread Group Execution
As an example if you have created a user profile for your performance testing purposes and if you want to remove the user after the test execution. You can create the request to delete the user in this thread group
3) Functional test mode(i.e. save Response data and Sampler Data)
When you run a huge set of requests I recommend you to NOT to use this. The reason is if you have selected this option it will include all the request and response data (including HTML, etc. ) in your log files. ( Normally it won't record your response and sampler data ) Even if you run the test in NON-GUI mode the log file would be few GBs if you have selected this option. So it's better to use this if you are debugging or running a less number of users in your test.
Run ThreadGroups consecutively(i.e one at a time)
If your test plan contains two thread groups i.e ThreadGroup-1 and ThreadGroup-2.
If above property is unchecked -then the active threads from both the thread group
will run parallel and
if checked - That means JMeter will start ThreadGroup-1 first, then ThreadGroup-2 and so on.
So by using this property you can instruct JMeter to run the Thread Groups serially.
Run tearDown ThreadGroups after shutdown of main threads
By default JMeter always run tear down thread group after completion of normal thread group. But if there is any failure in the above thread group and threads stopped due to some reason. Then this tear down thread group will not run. But if this property is checked then tear down thread group will always run.

Start JMeter thread after another thread

I want to run a thread x times. The thread group contains three samplers and because I dont want them to be mixed up in the result windows I only want to start the next thread when another is finished. I don't want to use a Ramp-Up Period because a thread could take 1 to 20 seconds.
You could use 3 thread groups and module controller (to referencd in the 2 other thread groups the elements in the first one to avoid copy ) and check on test plan the option:
Run Thread Group sequentially
Your use case is not very clear, however if you need to limit JMeter to X concurrent threads only the most obvious choice would be going for the Concurrency Thread Group
As per Advanced Load Testing Scenarios with JMeter Part 4 - Stepping Thread Group and Concurrency Thread Group article:
The Concurrency Thread Group provides a better simulation of user behaviour because it lets you control the length of your test more easily, and it creates replacement threads in case a thread finishes in the middle of the process.
You can install Concurrency Thread Group as a part of Custom Threads Group bundle using JMeter Plugins Manager
Regarding your three listeners bit, I would recommend reconsidering this approach as per JMeter Best Practices you should not be using any listeners, instead of it you need to run JMeter in non-GUI mode and use -l command-line argument to specify the results file name. Once your test is finished you can open the .jtl results file with a listener of your choice or generate a reporting dashboard from it.
You can use "jp#gc - Ultimate Thread Group". The Ultimate Thread Group provides flexible thread scheduling to your test scenario. It allows us to create a scheduled thread with advanced configuration. Start Threads Count, Initial Delay, Startup Time and Hold Load Time can be defined separately for each record.
You can define tasks to run consecutively.
This platform support flexible thread scheduling. You can read detailed wiki docs about the ultimate thread group.
Link: Loadium.com/wiki/ultimate thread

JMeter - Run an amount of thread groups at a time

Basically, I have 30 thread groups in my test plan and I would like to run 8 thread groups at a time consecutively until the test plan is done.
The main test plan options only allow parallel testing of all threads of 1 thread group at a time.
Is there any other way to achieve this apart from segmenting the thread groups in different JMX files or toggling them?
I'm entirely sure what you mean but I'm going to assume you want to run 8 thread groups simultaneously for a certain period, and than start another 8 thread groups and run those for a certain period etc.
You could do this quite easily with the Stepping Thread Group plugin: http://jmeter-plugins.org/wiki/SteppingThreadGroup/. You can adjust each thread group's start and end time.

Resources