使用soapUI对webservice进行功能和性能测试
上一篇 /
下一篇 2012-07-04 14:32:16
/ 个人分类:自动化测试
安装版本soapUI 4.0.1,基本的使用参考附件文档
一、new projects
右击“project”,选择“new soupUI project”,在弹出的对话框中输入project name和Initial WSDL/WADL http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?wsdl
勾选“Create Requests”"create TestSuite"和"relative paths" ,点击ok
在"Generate TestSuite"选择需要
测试的Operations,如getWeatherbyCityName:查询某个城市的天气信息
生成的项目结构如下:
二、添加属性
添加属性city和result,city发送的城市名称,result保存返回的结果
请求的xml中可直接使用属性的值,引用方式${#city}
三、添加断言
断言用于校验结果的正确性类似lr的检查点
返回的内容包含"深圳"
返回的xpath match,其中xpath expression如下,可以定位到返回的城市节点
declare namespace ns1='http://WebXml.com.cn/';
declare namespace soap='http://www.w3.org/2003/05/soap-envelope';
//soap:Envelope[1]/soap:Body/*:getWeatherbyCityNameResponse/*:getWeatherbyCityNameResult/*:string[2]
收藏
举报
TAG: