Skip to content

__FileToString

JMeter __FileToString function reference: syntax, parameters, and practical examples for parameterizing test plans with dynamic values.

Difficulty
intermediate
Guide type
reference
Estimated read time
1 min read
Last verified version
Verified JMeter 5.6

Also documented in context in the full Functions and Variables reference.

The FileToString function can be used to read an entire file. Each time it is called it reads the entire file.

If an error occurs opening or reading the file, then the function returns the string โ€œ**ERR**โ€

NameRequiredDescription
File NameYesPath to the file name. (The path can be relative to the JMeter launch directory)
File encoding if not the platform defaultNoThe encoding to be used to read the file. If not specified, the platform default is used.
Variable NameNoA reference name - refName - for reusing the value created by this function. Stored values are of the form \${refName}.

The file name, encoding and reference name parameters are resolved every time the function is executed.

On this page