啟動Jmeter后, 在Test plan下創建線程組:
1. 創建線程組(Thread Group)
在Thread Group界面,有一些線程的設置需要了解,如圖:
下面就可進行Http/Soap請求測試
測試的數據:
一. 測試Http請求
以下面的測試數據為例,進行http請求測試
1,創建Http請求(Http request) -add ->sampler(采樣器)

3. 設置完成http 請求頁面后,需要添加一個監聽器查看運行結果(Listener ->view results Tree)
4. 在View Results Tree界面可設置log 保存路徑,設置log保存的級別等(自己理解,還未實踐)
5. 在View Results Tree 界面點擊工具欄的綠色運行按鈕,查看執行結果:
二.用http request 測試soap請求
測試數據:
接口地址: http://www.webxml.com.cn/webservices/qqOnlineWebService.asmx
獲得騰訊QQ在線狀態
輸入參數:QQ號碼 String,默認QQ號碼:8698053。返回數據:String,Y = 在線;N = 離線;E = QQ號碼錯誤;A = 商業用戶驗證失敗;V = 免費用戶超過數量
SOAP 1.1
以下是 SOAP 1.2 請求和響應示例。所顯示的占位符需替換為實際值。
POST /webservices/qqOnlineWebService.asmx HTTP/1.1 Host: www.webxml.com.cn Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://WebXml.com.cn/qqCheckOnline" <?xml version="1.0" encoding="utf-8"?> <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> <qqCheckOnline xmlns="http://WebXml.com.cn/"> <qqCode>string</qqCode> </qqCheckOnline> </soap:Body> </soap:Envelope>
1. 創建Http請求(Http request) -add ->sampler(采樣器), 可修改采樣器名稱為soap requst
2. 在soap request頁面設置如下:
3. soap請求,還需要添加HTTP Header Manager:
4. 在HTTP Header Manager頁面設置參數:
5. 添加監聽器 view results tree, 運行,查看測試結果