2011-10-19 279 views
3

我需要使用JMeter測試web-srvice。 我已經創建了線程組500的測試計劃。 我需要爲每個線程傳遞新的參數值。 我聽說過「CSV數據集配置」,但它不允許我想要的,因爲如果我設置「共享模式」=「所有線程」,那麼每個線程將嘗試從文件中讀取每一行 - 我想傳遞第一個線程的第一個值,第二個線程的第二個值,等等。當然,我可以用一行創建500個文件,但這種方法很笨,很慢。 我怎樣才能以最好的方式做到這一點?謝謝。JMeter爲每個線程提供不同參數的測試計劃

回答

6

如果我理解正確,您希望thread1讀取row1和thread2來讀取row2,從而爲每個線程提供CSV文件中的唯一值。這正是「所有線程」所做的。您可以使用調試控制器來驗證這一點。

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

你是對的,當我選擇的所有線程則每個線程都需要下一行從文件。謝謝。 – Roman

相關問題