Controllers in JMeter: Loop, Simple, Transaction, Module, Random

What is the Logic Controller?

Logic Controllers let you define the order of processing request in a Thread. It lets you control “when” to send a user request to a web server. For example, you can use Random Controllers to send HTTP requests to the server randomly

Logic Controllers determine the order in which user request is executed.

Some commonly used Logic controllers are below:

How to use Controllers in JMeter

Recording Controller:

JMeter can record your Testing steps; a recording controller is a placeholder to store these recording steps.

How to use Controllers in JMeter

Simple Controller:

Simple Controller is just a container for user request.

How to use Controllers in JMeter

Loop Controller:

Loop Controller makes the user request run a specified number of times or run forever as shown in figure:

How to use Controllers in JMeter

Random Controller:

Random Controller makes all the user requests run in the random order in each loop period.

For example, you have 3 user requests to website http://www.google.com in following order:

  1. HTTP request
  2. FTP request
  3. JDBC request

These 3 requests should run 5 times. Total 15 user requests will be sent to Google server by JMeter.

In sequential order, requests are sent sequentially in following order:

HTTP request ->FTP request->JDBC request

for each loop.

How to use Controllers in JMeter

In random order, requests are sent as randomly,

FTP request ->HTTP request->JDBC request

Or

JDBC request ->FTP request->HTTP request

For each loop.

Module Controller:

The goal of Module Controller is to add modularity to JMeter.

The general idea is that web applications consist of small units of functionality (i.e. Logon, Create Account, Logoff…). This functionality can be stored in Simple Controller as “modules”. Module Controller will choose which module needs to run.

How to use Controllers in JMeter

Consider the following scenario –

You want to simulate:

  • 50 users logging out,
  • 100 users logging in
  • 30 users search www.google.com

You can use JMeter to create 3 modules. Each module simulates each user activity: Login, Logout, and Search.

How to use Controllers in JMeter

The Module controller chooses which module needs to run.

How to use Controllers in JMeter

Leave a comment

Your email address will not be published. Required fields are marked *