`
ruilin215
  • 浏览: 1097019 次
  • 性别: Icon_minigender_2
  • 来自: 成都
文章分类
社区版块
存档分类
最新评论

Web Services performance using LoadRunner HTTP Vuser script

 
阅读更多

通过使用LR的HTTP协议测试Web Services的性能【译文】

URL: http://blog.testsautomation.com/ ... e-using-loadrunner/
译者:Rita 原作者:Waldemar

一个小例子说明如何使用LR API测试Web Service性能

让我们说一下基于HTTPWeb Service使用SOAP协议。我们想测试发送请求和接收响应的速度有多快,因为我们的服务使用HTTP协议,我们可以使用简单HTTP协议的脚本去测试。
Action()
{
web_reg_save_param("Response","LB=", "RB=", LAST); //
用关联函数取得响应时间_rita
web_add_header("SOAPAction", "SampleMethod");
lr_start_transaction("REQ");
web_custom_request("Sample_Request","Method=POST",
"Mode=HTML",
"RecContentType=text/xml",
"EncType=text/xml; charset=utf-8",
"URL=http://example.com:1234/sample/",
"Body=<Envelope xmlns=/"http://example.com/sample/">/n"
" <Header/>/n"
" <Body>/n"
" <price><id>001</id></price>/n"
" </Body>/n"
"</Envelope>",
"LAST");
lr_end_transaction("REQ", LR_AUTO);
lr_output_message("Response is : %s/n", lr_eval_string("{Response}")); //
输出响应时间值
return 0;
}

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics