Introduction
Whether you are recording scripts or manually writing them, you will need to make use of controllers to aid the logic within your test plan. Logic controllers help determine the order in which samplers are processed in your test plans. Controllers are direct child elements of a Thread Group and contain one or more samplers. There are various controllers ranging from logic (random, if, switch, and so on) to looping (while, ForEach, loop, and so on), and recording controllers. At the time of writing this, JMeter comes bundled with 16 different controllers; more controllers can be provided by extending JMeter with plugins.
In this chapter, we will detail how to use five of the most frequently encountered controllers in the test plans. Due to page constraints, we are unable to cover all controllers. For a full list of bundled controllers including those not covered in this chapter's recipes, visit http://jmeter.apache.org/usermanual/component_reference.html#logic_controllers.