LoadRunner测试WebService的3种方式
2016-07-07 21:14
295 查看
LR在WebService虚拟用户协议中支持两种方式测试WebService,一种是通过“Add Service Call”的方式,一种是Import SOAP的方式。
Import SOAP的方式需要导入定义好的XML请求文件。
取到WebService返回的XML数据后,可以使用XPath的方式验证数据,LR提供了几个处理XML的函数:
lr_xml_get_values() //Retrieves values of XML elements found by a query
lr_xml_set_values() //Sets the values of XML elements found by a query
lr_xml_extract() //Extracts XML string fragments from an XML string
lr_xml_delete() //Deletes fragments from an XML string
lr_xml_replace() //Replaces fragments of an XML string
lr_xml_insert() //Inserts a new XML fragment into an XML string
lr_xml_find() //Verifies that XML values are returned by a query
lr_xml_transform() //Applies Extensible Stylesheet Language (XSL) Transformation to XML data
实际上,使用LR还有一种测试WebService的方式,就是采用HTTP协议,因为WebService是构建在HTTP协议之上的,因此可以WEB虚拟用户协议中的web_custom_request来构造WebService的请求。
学习LR测试WebService时,如果没有现成的WebService,又懒得写或不会写,可以用Parasoft网站的WSDL来试验:
http://soatest.parasoft.com/store-01.wsdl
参考:
http://blog.testsautomation.com/2009/07/web-services-testing-in-loadrunner/
http://blog.testsautomation.com/2009/05/validating-web-service-response-with-xpath/
http://blog.testsautomation.com/2009/01/web-services-performance-using-loadrunner/
Import SOAP的方式需要导入定义好的XML请求文件。
取到WebService返回的XML数据后,可以使用XPath的方式验证数据,LR提供了几个处理XML的函数:
lr_xml_get_values() //Retrieves values of XML elements found by a query
lr_xml_set_values() //Sets the values of XML elements found by a query
lr_xml_extract() //Extracts XML string fragments from an XML string
lr_xml_delete() //Deletes fragments from an XML string
lr_xml_replace() //Replaces fragments of an XML string
lr_xml_insert() //Inserts a new XML fragment into an XML string
lr_xml_find() //Verifies that XML values are returned by a query
lr_xml_transform() //Applies Extensible Stylesheet Language (XSL) Transformation to XML data
实际上,使用LR还有一种测试WebService的方式,就是采用HTTP协议,因为WebService是构建在HTTP协议之上的,因此可以WEB虚拟用户协议中的web_custom_request来构造WebService的请求。
学习LR测试WebService时,如果没有现成的WebService,又懒得写或不会写,可以用Parasoft网站的WSDL来试验:
http://soatest.parasoft.com/store-01.wsdl
参考:
http://blog.testsautomation.com/2009/07/web-services-testing-in-loadrunner/
http://blog.testsautomation.com/2009/05/validating-web-service-response-with-xpath/
http://blog.testsautomation.com/2009/01/web-services-performance-using-loadrunner/
相关文章推荐
- linux挂载windows文件夹
- 深度解决 SecurityException: User has not given permission to device UsbDevice
- jdk安装详解
- FSS指定磁盘布局进行vxvm的mirror-stripe(raid01)卷的制作
- Codeforces Round #361 (Div. 2) D Friends and Subsequences
- 如何解决mathpage.dll或MathType.dll文件找不到问题
- Codeforces Round #361 (Div. 2)E. Mike and Geometry Problem
- Leetcode Delete Node in a Linked List
- 集群管理脚本
- 外键约束
- 多线程面试必须掌握的
- systemctl 启动成功却提示没有权限(解决)
- LoadRunner如何在脚本运行时修改log设置选项
- AndroidStudio完美解决"Activity使用Handler时出现警告信息"的问题
- 微软2016实习生笔试--第三题Demo Day
- Android textview 文字中间加上图片
- 八大渲染引擎(如VRAY)的分析
- js笔记4-事件基础
- 在 windows 环境下部署redislive监控redis
- PHP中使用CURL实现GET和POST请求