Tuesday, September 8, 2020

Jmeter Controllers - Random Controller

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

 4. Random Controller

This controller works similarly as Interleave controller and the only difference is that this controller executes the sampler randomly for each iteration instead of sequence manner in Interleave controller. For example, if you have 5 samplers under this random controller and you are executing for 5 iterations. In this case, any samplers picked for first iteration and so on.

Let us see how this controller works in practical.

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

Step # 2: In this test plan, I have 6 HTTP samplers. Out of 6 samplers, I placed 5 samplers under Random Controller. I am going to execute the test plan for 5 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, First sampler (LIST USERS) is executed in every iterations (Total 5 times). Where as, the samplers are placed under Random Controllers executed randomly for every iteration. 

NOTE: Even if you place 'n' number of samplers under Random controller, it will execute only one sampler for each iteration and that one sampler will be picked 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 &#...