Functions in jmeter - __StringFromFile

This function is used to read data from text file or csv file.

Add a new thread group.Add a java req.

In its name type

 ${__StringFromFile(C:\FGFG\read.txt,filename,,)} 

And if we add a new java req and then type the same line in its name again it will print the same line again.

But please note if we run the same req a number of times by increasing the number of iterations it will move to next line and in the end iterate back to first line.

We can even make two java reqs and in first one in name give

${__StringFromFile(C:\FGFG\read.txt,filename,,)}
and in second one simply give ${filename} and in second one simply give ${filename} so it will print data that it read from file from that particular line.