Controllers in JMeter: Loop, Simple, Transaction, Module, Random
In JMeter, controllers are elements that help organize and
control the flow of test execution. Each controller serves a specific purpose
in managing the behavior of virtual users during performance testing. Let's
explore the different controllers available in JMeter:
1. Loop Controller:
The Loop Controller allows you to instruct JMeter to repeat
a set of samplers or requests a specified number of times. It is useful for
simulating multiple iterations of the same actions, such as sending repeated
API requests or navigating through a series of web pages.
2. Simple Controller:
The Simple Controller is a basic controller that helps
organize your test plan by grouping related samplers or other elements
together. It does not have any logic or looping functionality but serves as a
container to structure and manage the test plan.
Click here to explore |
3. Transaction Controller:
The Transaction Controller allows you to measure the
response time of a group of samplers as a single transaction. It is useful for
aggregating the response times of related requests, such as those involved in a
specific business transaction, to get an overview of the transaction's
performance.
4. Module Controller:
The Module Controller is used to include and reuse sections
of a test plan. It allows you to define reusable components, called "modules,"
and include them in different parts of the test plan. This promotes modularity
and simplifies test plan maintenance, especially when dealing with complex
scenarios.
5. Random Controller:
The Random Controller randomly selects and executes one of
the child samplers within it. This is helpful for simulating user behavior
where actions are taken randomly, such as accessing different pages of a
website or performing various operations in a non-sequential manner.
These controllers, when used in combination with other
elements like samplers, assertions, and listeners, enable testers to build
flexible and dynamic test plans that mimic real-world scenarios. By controlling
the flow and behavior of virtual users, JMeter empowers testers to conduct
accurate and comprehensive performance testing, helping identify potential
bottlenecks and issues in web applications and services.
Rationale Controllers let you characterize the request for handling demand in a Thread. It allows you to control "when" to send a client solicitation to a web server. For instance, you can utilize Random Controllers to send HTTP solicitations to the server haphazardly Rationale Controllers decide the request where client demand is executed. Some normally utilized Logic regulators are beneath Arbitrary Controller: Arbitrary Controller makes all the client demands run in the irregular request in each circle period. For instance, you have 3 client solicitations to site http://www.google.com in following request :HTTP demand FTP demand demand
These 3 solicitations ought to run multiple times. Complete 15 client solicitations will be shipped off Google server by JMeter. In successive request, demands are sent consecutively in following request: HTTP demand - >FTP demand >JDBC demand for each circle. In arbitrary request, demands are sent as arbitrarily FTP demand - >HTTP demand >JDBC demand Or then again JDBC demand - >FTP demand >HTTP demand For each circle. Module Controller: The objective of Module Controller is to add measured quality to JMeter. The overall thought is that web applications comprise of little units of usefulness (for example Logon, Create Account, Logoff… ). This usefulness can be put away in Simple Controller as "modules". Module Controller will pick which module needs to run Other Important Controllers:
Interleave Controller: gets and makes one of client demand run in each circle of the string. Runtime Controller: controls how long its kids are permitted to run. For instance, in the event that you determined Runtime Controller 10 seconds, JMeter will run your test for 10 seconds. Exchange Controller: gauges the general time taken to complete a test execution Incorporate Controller: is intended to utilize an outside test plan. This regulator permits you to utilize different test plans in JMeter. See detail in JMeter Performance Testing. Circle Controller Example This part shows you bit by bit guidance to add Loop Controller set to your ongoing exhibition test plan.
The Loop Controller makes the samplers run as a specific number of times, notwithstanding the circle esteem you indicated for the Thread Group. For instance, if you Add one HTTP Request to a Loop Controller with a circle count 50Arrange the Thread Group circle build up to 2Then, at that point, JMeter will send a sum of 50 * 2 = 100 HTTP Requests. This is the guide of this model: Arranging Loop Controller Add esteem 50 to Loop Count field as underneath figure. It will make one client solicitation to the web server google.com run it multiple times, notwithstanding the circle esteem =2, you indicated for the Thread Group above. So JMeter will send a sum of 2 * 50 = 100 HTTP Requests.