如何让 Jmeter 将 CSV 数据用于 GET 参数? [英] How to get Jmeter to use CSV data for GET parameters?

查看:31
本文介绍了如何让 Jmeter 将 CSV 数据用于 GET 参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 JMETER 中实现以下目标

  1. Jmeter 加载带有 ID 号的 CSV 文件
  2. Jmeter 中的每个用户/线程都会选择一个 ID 号并将其添加到他们的 HTTP 请求中,例如http:www.testsite.com/test.php?id=x
  3. 重复第 2 步,选择文件中的下一个 ID 号.

这样我就可以测试我的 servlet 是否正在使用连接池执行多线程.

我尝试在此处手动输入值

然而这是行不通的.

架构布局:

谢谢

解决方案

您可以尝试如下实现您的架构:

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

<块引用>

id1编号2...身份证号码

2. 使用以下架构:

<前>CSV 数据集配置文件名:[带有测试 ID 的 csv 文件的路径]变量名:testID //提取的id可以引用为${testID}在EOF上回收?错误的在 EOF 上停止线程?真的共享模式:当前线程 //此模式允许每个线程使用来自csv的所有值线程组线程数:N //测试线程数(用户)循环次数:永远...HTTP 请求 //你的 http 调用服务器名称或 IP:www.testsite.com路径:/test.php?id=${testID} //使用提取ID的变量...

I am wanting to achieve the following in JMETER

  1. Jmeter loads CSV file with id numbers
  2. Each user/thread in Jmeter picks a id number and adds it to their HTTP request e.g. http:www.testsite.com/test.php?id=x
  3. Repeat step 2 , selecting the next id number in the file.

This is so I can test that my servlet is performing multiple threads with connection pooling.

I have tried manually entering in values here

However this is not working.

Schema Layout:

Thanks

解决方案

You can try to implement your schema as below:

1. Prepare your test-IDs in csv-file, e.g. in the following format:

id1
id2
...
idN

2. Use the following schema:

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
. . .

这篇关于如何让 Jmeter 将 CSV 数据用于 GET 参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆