Book Image

JMeter Cookbook

By : Bayo Erinle
Book Image

JMeter Cookbook

By: Bayo Erinle

Overview of this book

Table of Contents (16 chapters)
JMeter Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Leveraging ForEach Controller in test plans


Another variation of Loop Controllers you might sometimes encounter is the ForEach controller. These are a specialized form of controllers that loop through the values of a set of related values. The number of iteration execution is dynamically defined by the resolution of the related variables as opposed to a fixed number specified in loop controllers. This makes ForEach Controllers a good fit for use cases where you need to perform repetitive executions of samplers based on some information from the target application.

How to do it…

In this recipe, we will cover how to use ForEach controllers paginating through the posts of our sample application. This is going to be very similar to what was covered in the Using Loop Controller in test plans recipe, only this time, we will use the ForEach Controller to give you an idea of how it can be used to achieve a similar result. Perform the following steps:

  1. Launch JMeter.

  2. Click on the Templates… button (right...