Tuesday, September 8, 2020

Jmeter Controllers - Loop Controller

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

6. Loop Controller

This controller executes the samplers for specified number of times in the Thread Group. This controller will be useful when you want to hit particular request multiple times. Post payment is one of the classic example for this case. When you make the payment call, the initial response for the status is PENDING and it will take few seconds to update as ACCEPTED/SUCCESSFUL. So you have to keep on hitting this payment call again and evaluate the response each time if the status is changed to ACCEPTED/SUCCESSFUL.

Let us see how this controller works in practical.

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

Step # 2: In this test plan, I have 3 HTTP samplers. Out of 3 samplers, I placed 1 sampler under Loop Controller. I am going to execute the test plan for 1 iteration with 1 thread. Loop count is specified as 5 in Loop controller

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

Step # 4: Execute the test plan.

As you see the above snapshot, SINGLE USER is executed 5 times (based on loop count) though the test plan is executed for only one iteration. Also, other samplers are executed only once as they are not placed in Loop controller.

That's all. Simple, isnt' it?

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 &#...