jmeter 函数 FileToString(path) 是否会采用动态值。
我需要使用大约 400 个 json 文件作为输入。因此计划在正文数据中使用 FileToString($fileName}) 。通过提供 csv 中的文件名列。但 Jmeter 似乎正在检查文件名作为文件,而不是从 csv 中获取值。
最佳答案
您需要将您的 ${fileName}
包装到 __eval() 中功能。根据文档:
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.
因此您需要将表达式更改为:
${__FileToString(${__eval(${fileName})},,)}
有关 JMeter 功能的更多信息,请参阅 How to Use JMeter Functions帖子系列。
关于jmeter - jmeter函数FileToString(path)会采用动态值吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30650959/