標籤:des style blog http io os 使用 ar strong
1. 重新命名測試計劃
啟動JMeter,點擊測試計劃節點上,重新命名此測試計劃節點:WebserviceTest.如:
2. 添加線程組
添加一個線程組,按右鍵測試計劃 WebserviceTest -添加 - Threads(Users) > 線程組。接下來,讓我們修改線程組的預設屬性,以滿足我們的測試。改變以下屬性: Name: Number of Users Number of Threads (Users): 5 Ramp-Up Period: 5 Loop Count:2 3. 添加配置元件 a.按右鍵測試計劃 WebserviceTest -添加 -配置元件 > 使用者定義的變數,名稱:User Defined Variables 點擊添加,設定名稱:host,設定值:wsf.cdyne.com,設定Description:Host of Webservice. b. 按右鍵測試計劃 WebserviceTest -添加 -配置元件 > HTTP請求預設值,名稱:HTTP Request Defaults 點擊添加,設定伺服器名稱或IP:${host} 4. 添加取樣器 按右鍵線程組 Number of Users-添加 -Sampler > HTTP請求,設定如下參數: 名稱:Soap Request 路徑:/WeatherWS/Weather.asmx BodyData:
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetCityForecastByZIP xmlns="http://ws.cdyne.com/WeatherWS/">
<ZIP>60601</ZIP>
</GetCityForecastByZIP>
</soap:Body>
</soap:Envelope>
5. 添加監聽器 按右鍵線程組 Number of Users-添加 -監聽器> 察看結果樹 6. 運行此測試計劃 現在儲存的以上測試計劃 test_webservice.jmx。執行本測試計劃使用 Run > Start 選項。 至此,整個測試計劃就完成了。
JMeter學習(十一)WebSerivice測試計劃