当前位置:网站首页>JMeter loop controller and CSV data file settings are used together

JMeter loop controller and CSV data file settings are used together

2022-07-07 10:21:00 Splendid Qianyang 813

Catalog

1. Preparation before execution

2. Execution order


1. Preparation before execution

Demand is : There is a variable , The variables are 3 Values need to be executed circularly , Look at the results ;

  • Add thread group
  • add to http request
  • Add loop controller
  • add to CSV Data file settings
  • Add debugger ( You can check whether the value obtained each time is correct )

2. Execution order

1.CSV file 、 debugging 、 request

What I use is a variable , If there are multiple variables , It can be separated by English commas ;

CSV The file is consistent with the setting of the number of cycles , For example, the data value in the file is 3 individual , Then cycle 3 Time ( Of course, the loop is also related to the number of loops in the thread group , The default thread group is 1).

It should be noted that CSV It needs to be placed under the cycle controller , Otherwise, the file is not read correctly , Of course, the request interface should also be placed under the loop controller .

2. Correct sorting

 tips: Sort according to the pictures , The execution result is three groups ( The cycle controller is set to cycle 3 Time )

  • The request is not placed under the loop controller , Then the file executes only the first value , The remaining two... Will not be executed ;
  • The same is true for debugging the sampler , If placed outside the cycle controller , Then only the data of the last execution will be displayed , The data will not be displayed every time ;

3. Related to thread group

  If you set 3 Time , The final result is 9 Time , That is, the thread group is the largest loop , The circulation controller is on the inner layer .

原网站

版权声明
本文为[Splendid Qianyang 813]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130623332265.html