JMeter测试计划,每个线程具有不同的参数 [英] JMeter test plan with different parameter for each thread

查看:918
本文介绍了JMeter测试计划,每个线程具有不同的参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用JMeter测试网络服务. 我已经使用线程组500创建了测试计划. 我需要为每个线程传递参数的新值. 我听说过"CSV数据集配置",但是它不允许我想要的,因为如果我设置共享模式" =所有线程",则每个线程将尝试从文件的每一行读取-我想要传递文件中的第一个值用于第一个线程,第二个值用于第二个线程,依此类推.当然,我可以用一行创建500个文件,但是这种方法既愚蠢又缓慢. 我怎样才能最好地做到这一点?谢谢.

I need to test web-srvice with JMeter. I've created test plan with Thread-group 500. I need to pass for each thread new value of parameter. I've heard about "CSV Data Set Config", but it doesn't allow what I want, because if I set "Sharing mode" = "All threads" then each thread will try to read from file each row - I want pass first value in file for first thread, second value for second thread and so on. Of course I can create 500 files with one line but this approach is stupid and slow. How can I do that in best way? Thanks.

推荐答案

如果我理解正确,则希望线程1读取row1,线程2读取row2,从而为每个线程提供CSV文件中的唯一值.这正是所有线程"所做的.您可以使用调试控制器进行验证.

If I understand correctly, you want thread1 to read row1 and thread2 to read row2, thus giving each thread a unique value from the CSV file. This is exactly what "ALL THREADS" does. You can use a debug controller to verify this.

http://jmeter.apache.org/usermanual/component_reference.html#CSV_Data_Set_Config

* All threads - (the default) the file is shared between all the threads.
* Current thread group - each file is opened once for each thread group in which the element appears
* Current thread - each file is opened separately for each thread
* Identifier - all threads sharing the same identifier share the same file. So for example if you have 4 thread groups, you could use a common id for two or more of the groups to share the file between them. Or you could use the thread number to share the file between the same thread numbers in different thread groups.

这篇关于JMeter测试计划,每个线程具有不同的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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