jMeter:在http请求体上加载文件内容

jMeter: load file content on http request body

我正在尝试将文件内容注入请求正文:

我正在使用:

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

我已经使用 directory listing plugin:

配置了 bundle 变量

当我执行测试时,我得到:

日志让我:

2021-12-28 16:33:53,853 WARN o.a.j.f.FileToString: Could not read open: /patient-bundle-0193.json

根据我的配置,__FileToString 应该读取 /home/jeusdi/projects/workarea/salut/mpi/jsons/bundles/extractions/10000/bundles 而不是 /...

有什么想法吗?

勾选 Use full path 这样您的 bundle JMeter Variable 将包含文件的绝对位置。

请注意,可以使用 Debug Sampler and View Results Tree 侦听器组合可视化 JMeter 变量及其各自的值。

您可能还对 Introducing the Directory Listing Config Plugin on JMeter 文章感兴趣