代码之家  ›  专栏  ›  技术社区  ›  Jordi

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

  •  0
  • Jordi  · 技术社区  · 4 年前

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

    enter image description here

    我正在使用:

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

    我已经配置了 bundle 变量,使用 directory listing plugin :

    enter image description here

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

    enter image description here

    日志让我:

    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 而不是来自 / 。。。

    有什么想法吗?

    0 回复  |  直到 4 年前
        1
  •  1
  •   Dmitri T    4 年前

    打上钩 Use full path 所以你的 bundle JMeter Variable 将包含文件的绝对位置。

    enter image description here

    请注意,JMeter变量及其各自的值可以使用 Debug Sampler 和 View Results Tree 听众组合。

    你可能也感兴趣 Introducing the Directory Listing Config Plugin on JMeter 文章