Tuesday, September 8, 2020

Jmeter Controllers - Random Order Controller

 This is fifth controller in Jmeter Controllers series. If you don't read the previous posts in this series, I would suggest you to read it here.

 5. Random Order Controller

This controller works similarly as Random controller and the only difference is that this controller executes all the samplers randomly for each iteration instead of one sampler in Random controller. For example, if you have 5 samplers under this Random Order controller and you are executing for 5 iterations. In this case, all 5 samplers are executed in first iteration, but not in the same order defined in random controller. It will be executed randomly.

Let us see how this controller works in practical.

Step # 1: Add the Random Order controller into test plan. Right click on Thread Group -> Add -> Logic controllers -> Random Order Controller

Step # 2: In this test plan, I have 6 HTTP samplers. Out of 6 samplers, I placed 5 samplers under Random Order Controller. I am going to execute the test plan for 2 iterations with 1 thread.

Step # 3: Add listener "View Results Tree" to the test plan.

Step # 4: Execute the test plan.

As you see the above snapshot, LIST USERS is executed first in every iterations (Total 2 times). Where as, all the samplers are placed under Random Order Controller executed randomly. In first iteration, CREATE sampler executed as 4th sampler (SINGLE USER NOT FOUND -> SINGLE <RESOURCE> -> LIST <RESOURCE> -> CREATE) in Random Order Controller though it is placed as 5th Sampler in the controller. Whilst, the same CREATE sampler is executed first and followed by LIST <RESOURCE> and so on in the second iteration.

NOTE: If you place 'n' number of samplers under Random Order controller, it will execute all the samplers for each iteration, but picked up randomly by Jmeter.

That's all. Simple, isnt' it?


No comments:

Post a Comment

Linux Series - SED Utility/Package - 4. Deleting Lines

Let’s explore sed’s explicit delete command, which you specify by using the option 'd'. Again, we are using the sample file named &#...