- The Thread Group has an implicit Loop Controller inside it:
the next line from CSV will be read as soon as
LoopIterationListener.iterationStart() event occurs, no matter of
origin
It is safe to use CSV Data Set Config as it doesn’t keep the whole file in the memory, it reads the next line only when the aforementioned
iterationStart()
event occurs. However it keeps an open file handle. If you do have really a lot of RAM and not enough file handles you can read the file into memory at the beginning of the test using i.e. setUp Thread Group and JSR223 Sampler with the following preSampleResult.setIgnore()
new File(‘/path/to/csv/file’).readLines().eachWithIndex { line, index ->
props.put(‘line_’ + (index + 1), line)
}
once done you will be able to refer the first line using __P()
function as
${__P(line_1,)}, second line as ${__P(line_2,)}, etc.


