Search code examples
jmeterperformance-testingload-testing

How to execute the CSV file multiple times in jmeter


I have a CSV file(containing 2 requests) and I would like to execute JMeter in the below fashion:

THREAD 1:
    LoopCount 1
         Request 1
         Request 2
    LoopCount 2
         Request 1
         Request 2
    LoopCount 3
         Request 1
         Request 2

My current JMX file looks like below

THREAD GROUP(Threads=1, LoopCount=3):
     Loop Controller(LoopCount=forever)
         HTTP Request
         CSV Data Config(Recycle on EOF=False, Stop Thread on EOF=True)

But it executes only one time(1 loop). And if I modify Recycle on EOF = True, it executes forever.


Solution

    1. You have Stop Thread on EOF=True which instructs JMeter to stop the thread (virtual user) when the end of file is reached
    2. You have Loop Controller configured to loop forever which means that your test will never end
    3. You have Recycle on EOF=False which means that when the last line of the CSV file is reached you will get <EOF> value stored in the respective variable for each and every next request

    So

    • remove this Loop Controller
    • and reset CSV Data Set Config to its default settings in terms of recycling / stopping thread on the end of file:

    enter image description here

    In the above demo image:

    More information: Using CSV DATA SET CONFIG