Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will jmeter function FileToString(path) takes dynamic values

Tags:

jmeter

Will jmeter function FileToString(path) takes dynamic values.

I need to use around 400 json files as a input. so planning to use FileToString($fileName}) in body data. By providing the filename column in csv. But it seems Jmeter is checking filename as file instead of getting value from csv.

like image 557
Beginner Avatar asked Aug 31 '25 17:08

Beginner


1 Answers

You need to wrap your ${fileName} into __eval() function. As per documentation:

The eval function returns the result of evaluating a string expression.

This allows one to interpolate variable and function references in a string which is stored in a variable.

So you need to change your expression to look like:

${__FileToString(${__eval(${fileName})},,)}

For more information on JMeter functions see How to Use JMeter Functions post series.

like image 193
Dmitri T Avatar answered Sep 03 '25 22:09

Dmitri T