How to use CSV data set config inside a while loop in JMeter?

后端 未结 1 996
走了就别回头了
走了就别回头了 2021-01-05 07:01

I need to test the same set of urls against 5 to 10 servers. URLs are defined in the CSV file. Server names are defined in User Defined Variables config.

I\'m using

相关标签:
1条回答
  • 2021-01-05 07:53

    Quote from JMeter Manual of CSV Data Set:

    By default, the file is only opened once, and each thread will use a different line from the file. However the order in which lines are passed to threads depends on the order in which they execute, which may vary between iterations. Lines are read at the start of each test iteration. The file name and mode are resolved in the first iteration.

    Thread groups cannot be nested. So you have to use the threadgroup to iterate in CSV and foreach to iterate in something else. The second option is to generate a CSV with the URL+Server variations, and using simply a single threadgroup to read the CSV.

    First option is here.

    Iterating URLs outer loop, iterating servers inner loop. You just need a threadgroup and a foreach inside it. See the pictures: User defined variables (servers) enter image description here enter image description here enter image description here

    Sample results: enter image description here enter image description here enter image description here

    And of course 3 more results...

    You can also play with CSVRead function if you have time :)

    0 讨论(0)
提交回复
热议问题