如何让Jmeter使用CSV数据获取参数?

如何让Jmeter使用CSV数据获取参数?,jmeter,Jmeter,我希望在JMETER中实现以下目标 Jmeter加载带有id号的CSV文件 Jmeter中的每个用户/线程选择一个id号并将其添加到HTTP请求中,例如HTTP:www.testsite.com/test.php?id=x 重复步骤2,选择文件中的下一个id号 这样我就可以测试我的servlet是否使用连接池执行多线程 我已尝试在此处手动输入值 然而,这是行不通的 架构布局: 谢谢您可以尝试实现以下模式: 1。在csv文件中准备您的测试ID,例如以下格式: 2.使用以下模式: CSV Data

我希望在JMETER中实现以下目标

  • Jmeter加载带有id号的CSV文件
  • Jmeter中的每个用户/线程选择一个id号并将其添加到HTTP请求中,例如HTTP:www.testsite.com/test.php?id=x
  • 重复步骤2,选择文件中的下一个id号
  • 这样我就可以测试我的servlet是否使用连接池执行多线程

    我已尝试在此处手动输入值

    然而,这是行不通的

    架构布局:


    谢谢

    您可以尝试实现以下模式:

    1。在csv文件中准备您的测试ID,例如以下格式:

    2.使用以下模式:

    CSV Data Set Config Filename: [path to your csv-file with test-IDs] Variable Names: testID // extracted id can be referred as ${testID} Recycle on EOF? False Stop thread on EOF? True Sharing mode: Current thread // this mode allows EACH thread use ALL values from csv Thread Group Number of Threads: N // count of your test-threads (users) Loop Count: Forever . . . HTTP Request // your http call Server Name or IP: www.testsite.com Path: /test.php?id=${testID} // use variable with extracted ID . . . CSV数据集配置 文件名:[带测试ID的csv文件路径] 变量名:testID//提取的id可以称为${testID} 在EOF上回收?假的 在EOF上停止线程?真的 共享模式:当前线程//此模式允许每个线程使用csv中的所有值 螺纹组 线程数:N//测试线程数(用户) 循环计数:永远 . . . HTTP请求//您的HTTP调用 服务器名称或IP:www.testsite.com Path:/test.php?id=${testID}//使用具有提取id的变量 . . .
    谢谢-我已经尝试过你的模式布局,但是当我单击开始时,它不会运行测试。请参阅更新后的问题,按照上面的答案简单地实现模式:1。CSV数据集配置应放在测试计划中的线程组之前;2.使用HTTP请求采样器()发送您的请求;HTTP Request Defaults config是为所有请求只设置公共部分的方法,例如服务器名称(而不是路径)。 CSV Data Set Config Filename: [path to your csv-file with test-IDs] Variable Names: testID // extracted id can be referred as ${testID} Recycle on EOF? False Stop thread on EOF? True Sharing mode: Current thread // this mode allows EACH thread use ALL values from csv Thread Group Number of Threads: N // count of your test-threads (users) Loop Count: Forever . . . HTTP Request // your http call Server Name or IP: www.testsite.com Path: /test.php?id=${testID} // use variable with extracted ID . . .