LoadRunner測試WebService的3種方式

來源:互聯網
上載者:User

標籤:

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/

LoadRunner測試WebService的3種方式

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.