前言
JMeter3.2版本之后就沒有SOAP/XML-RPC Request插件了,那么該如何進行webservice接口的測試呢?
今天我們來一起學習一下怎么在3.2以后版本的JMeter進行webservice接口測試吧!
一:在測試計划下添加配置元件-HTTP信息頭管理器,並在界面添加Content-Type信息,Content-Type:text/xml;charset=utf-8
二:添加線程組,線程組下添加取樣器-HTTP請求,寫入正確的webservice接口地址和參數
三:添加監聽器-察看結果樹,點擊運行,查看執行結果
附:
Web Services地址:http://www.webxml.com.cn/zh_cn/web_services.aspx
接口地址:/WebServices/WeatherWS.asmx
接口參數:
<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> <getRegionProvince xmlns="http://WebXml.com.cn/" /> </soap:Body> </soap:Envelope>