JMeter test plan with different parameter for each thread

我只是一个虾纸丫 提交于 2020-01-03 13:09:09

问题


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:


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.


来源:https://stackoverflow.com/questions/7823285/jmeter-test-plan-with-different-parameter-for-each-thread

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!