A ForEach Action loops through the values of its input variable. For each successive value, the output variable is affected and the children actions are executed. The actions below the ForEach can use the output variable in their configuration.
The input variable format is special. You can define a ForEach input in two ways:
- Create a Regex Post Processor and select "All" as the match number. In this case the ForEach children are processed for each extracted value.
- If your input variable is named
myVar, create multiple variables named:
- and the output variable consecutively have the values of
Here's an example with a regex called "items" set to match number "All":
You can download a JMX of this example here and import it in your project using the JMeter project option.
To sum up:
|Input Variable Name||Name of the input variable.
|Output Variable Name||Name of the output variable.