Execute requests from the scenario in random order [Taurus/JMeter] - jmeter

I have a pretty big load test scenario for execution that I want to run with Taurus. It has more than 1000 different requests - some of them in loops because I would like them to execute several times.
Now that I have the scenario completed I'm looking for a way to randomise the requests during the execution. For example instead of the Taurus running the tests line by line from the scenario I would like Taurus to execute requests from the scenario in random order.
Any ideas how this can be achieved?

You can add to JMeter test plan Random Controller
Random Logic Controller acts similarly to the Interleave Controller, except that instead of going in order through its sub-controllers and samplers, it picks one at random at each pass.
You can even set 1 request at a time
ignore sub-controller blocks If checked, the interleave controller will treat sub-controllers like single request elements and only allow one request per controller at a time.

Related

250 users hitting around 60k overall requests in jmeter

I have 250 users ,and around 60000 sample counts should be hit including all the requests. Whichever request is supposed to get huge sample count,I have put those request within loop count,But the requests outside the loop are getting executed only 3-4 times which is less than expected. How do I handle this?
It is not very possible to provide the comprehensive answer without knowing what you're trying to achieve and seeing your test or at least Thread Group configuration
The easiest option is moving the requests which you want to execute more times into a separate Thread Group
If the requests have to stay in one Thread Group you can control the frequency using Throughput Controller
If the logic is more complex - consider using Switch Controller or Weighted Switch Controller

How can i execute several scenarios simultaneously without using several thread groups

I have created seven thread groups which execute different scenarios in one application. I'm trying to optimize my scripts in order to be more maintainable and easy to master when someone else uses them.
The thing that i cannot figure out is how can i combine those thread groups into one or two and to still have the seven different execution paths and the possibility to control them, by control i mean to set how many users to execute scenario 1, how many to execute scenario 2 etc. till 7.
Currently the test plan looks like this
If you don't want several thread groups for some reason the alternative options are in:
Throughput Controller - with different global executions or execution percentages
Switch Controller - which provides random weighted values (in some cases Throughput Controller doesn't guarantee that samplers in scope will ever be executed)
See Running JMeter Samplers with Defined Percentage Probability guide for more information on configuration and implementation.
Well i just figured out how to do that i have added a Loop controller a Random Order Controller as child of the loop controller. And i have put seven throughput controllers as child of the Random Order Controller so now everything looks fine

How to run jmeter samplers sequentially for multiple requests

I am trying to run http samplers sequentially for multiple requests. Where the output of 1 API response is the input of next API request. My concern is when I run with 5 users (for. e.g), then at given point of time it first executes 1st API with 5 users then second API with 5 users, in this process the API where input is required gets lost. Please help me on this. I need a solution, where all the samplers are first executed for first user, then for second thread all the samplers are executed and so on.
Dzizu is correct, threads are independent so you are going to run into problems with this approach.
Since you are using 5 users across the test, it would be better to have one thread group with 5 users, and then have Simple controllers (or Transaction controllers) that hold the HTTP samplers and whatever else you are using. This will ensure that the samplers are executed concurrently, but they can still share data if required.
Simple example below:
Threads usually are independent. The easiest way in my opinion is to put full process in one thread and then multiply threads in thread groups.
Eventually I tried to solve this by using loop count option. For example if I want to simulate 5 users in 1 second, I set values as loop count=5,threads=1,ramp-up=.2.
This worked for me so give it a try.
Use the Transaction Controller or Simple Controller to group your samplers together and run them in sequence without worrying about the number of threads. For me, it is working as expected :).

Loop interleave controller

I am trying to use the interleave controller inside another controller (ForEach OR Loop OR any other) such that each of the sampler (which is HTTP request) under Interleave controller is executed once and the test exits the "outer" controller once the last sampler is done.
My test plan looks somewhat like show below
test plan
--Loop controller ( with loop count = num of requests in Interleave Controller)
----Some test elements
----Interleave Controller
--------HTTP requests (count = n, with some differences)
----Some More test elements
The test plan is to test multiple test scenarios of a lot of REST services (having some changes in the request data etc) so some services might have 2 scenarios some might have 10.
Thus is there any way of getting the number of samplers under the interleave controller ? OR a better design to my test plan.
Thanks
Have a look at the interleave documentation as it explains nicely how it works and how one sampler, going from top to bottom, is executed per iteration. If you want only one sampler executed randomly (per iteration) you can use the random controller.
Note: Those controllers don't stop by them selves if all children have been executed. They start all over again. If you want to stop you have to add different logic to make that happen.

Test concurrent users with different browsing patterns

So using Jmeter today and whilst I know i can load test a website with concurrent users using threads, loops etc I was wondering if it is possible to setup a test where say 50 users access the website and then each of them browse the site in a different way?
Has anyone done this before or would jmeter not be the tool to use?
Looking for some suggestions or an idea how to do it in Jmeter.
Suppose you have at least the following simple possibility:Random Order Controller.
Implement set of navigation/browsing steps via separate samplers or group of samplers (grouped via e.g. Simple Controller or Transaction Controller - if some steps should be always executed in defined sequence).
This will be "pool" of navigation steps.
Adding all these steps as child samplers to the Random Order Controller let you have different, per user, randomly generated sequence of navigation steps.
In this case you possible have to put your login/logout samplers (if any) out from Random Order Controller. As well you can e.g. use both scenarios with and without login/logout, etc.
Thread Group
...
Login Sampler
Random Order Controller
Sampler A
Sampler B
...
Sampler X
Logout Sampler
...
As well you can also additionally look onto
Random Controller
Switch Controller: e.g. define in csv-file per-user navigation scenarios, read these scenarios during script execution and assign extracted actions to each thread;
Include Controller.

Resources