我想在 JMETER 中实现以下目标
- Jmeter 加载带有 ID 号的 CSV 文件
- Jmeter 中的每个用户/线程都会选择一个 ID 号并将其添加到他们的 HTTP 请求中,例如http:www.testsite.com/test.php?id=x
- 重复第 2 步,选择文件中的下一个 ID 号。
这样我就可以测试我的 servlet 是否正在使用连接池执行多个线程。
我已尝试在此处手动输入值
但是这不起作用。
架构布局:
谢谢
最佳答案
您可以尝试如下实现您的架构:
1. 在 csv 文件中准备您的测试 ID,例如格式如下:
id1 id2 ... idN
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 . . .
关于jmeter - 如何让 Jmeter 将 CSV 数据用于 GET 参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13341597/