微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

LoadRunner测试WebService的3种方式

LRWebService虚拟用户协议中支持两种方式测试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/

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐