想象一些场景
1、连续发10个相同的请求
2、其中前两个做特殊处理
Logic Controller出场
1、首先必须声明的是: Jmeter中的Controller 和 LoadRunner中的Controller的区别。
2、回到执行顺序。查看Controller的执行顺序
Simple Controller
1、 The Simple Logic Controller lets you organize your Samplers and other Logic Controllers. Unlike other Logic Controllers, this controller provides no functionality beyond that of a storage device.
2、提供一个块的结构和控制。更方便,更清晰。 例子 SimpleComtroller.jmx
3、嵌套其他的Controller
4、适用场景
Loop Controller
1、 简单的说就是提供一个循环
2、查看例子 LoopComtroller1.jmx
LoopComtroller2.jmx
3、适用场景
Once Only Controller
1、 The Once Only Logic Controller tells JMeter to process the controller(s) inside it only once per Thread, and pass over any requests under it during further iterations through the test plan.
2、 例子 OnceOnlyController1.jmx
OnceOnlyController2.jmx
OnceOnlyController3.jmx
3、适用场景
ForEach Controller
1、 The ForEach Controller is used in tandem with User Defined Variables (UDV). It is a variant of a Loop Controller as every sampler or controller that we add is executed one or more times according to the number of times to repeat. 2、 例子 ForEach1.jmx
ForEach2.jmx
3、适用场景
Transaction Controller
1、 The Transaction Controller generates an additional sample which measures the overall time taken to perform the nested test elements. 2、 例子 TransactionController1.jmx
TransactionController2.jmx
3、适用场景
If Controller
1、The If Controller allows the user to control whether the test elements below it (its children) are run or not. 2、 例子 IfController1.jmx
IfController2.jmx
IfController3.jmx
IfController4.jmx
IfController5.jmx
3、适用场景