问题
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