2012-09-06 99 views
2

我有一個包含100個記錄/行的CSV,我希望使用JMeter執行(通過服務)。對於CSV中的每個記錄,Jmeter多次執行

現在,我想執行每個記錄3次(每次延遲5秒後),並對CSV中的所有100條記錄執行相同操作。

如何使用JMeter做到這一點?

+0

您的問題不明確,可能的數據,應該怎麼DOND可以幫助 –

+1

例如[?得到的答案](http://stackoverflow.com/FAQ#howtoask) –

回答

6

這看起來並不是很難用jmeter的standard components實現。

  1. 使用正確配置的CSV Data Set ConfigWhile Controller下讀取您的csv文件中的所有條目。
  2. 在同一循環中,使用Loop Controller設置爲所需的循環計數 - 這將使用從每個csv-entry提取的變量重複您的請求N次。
  3. Under Loop Controller使用合適的sampler,例如, HTTP Request Sampler,用csv-entry的params發送你的請求。
  4. 隨着採樣器使用任何timer,例如, Constant Timer,在每次請求後添加延遲。

架構可能看起來像:

 
Thread Group 
Number of Threads = 1 
Loop Count = 1 
    . . . 
    While Controller     // this will iterate through your csv-file 
    Condition = ${__javaScript("${var1}"!="",)} // this will repeat until EOF 
     CSV Data Set Config 
     Filename = ...    // path to your csv file 
     Variable Names = var1,... // these are records read from file into pointed variables 
     Delimiter = , 
     Recycle on EOF? = False 
     Stop thread on EOF? = True 
     Sharing Mode = Current thread group 

     Loop Controller 
     Loop Count = 3 
      HTTP Request Sampler 
      Constant Timer 
      Thread Delay (in ms) = 5000 
     . . . 
相關問題