在LoadRunner脚本中处理HTTP重定向
2010-08-02 15:59
337 查看
参考:
Handle HTTP Re-Directions in LoadRunner Scripts yourself
http://ptfrontline.wordpress.com/2010/04/11/handle-http-re-directions-in-loadrunner-scripts-yourself/
Action()
{
int HttpRetCode=0;
// Set redirection depth to 0
web_set_option("MaxRedirectionDepth", "0", LAST);
// Initial Location where we want to go
lr_save_string("http://www.mercury.com", "Location");
do
{
// Save new Redirection Info (Location: header)
web_reg_save_param("Location",
"LB=Location: ",
"RB=\r\n",
"Ord=1",
"NotFound=Warning",
"Search=Headers",
LAST );
// do any web call (This needs to be modified to suit your needs)
web_url("my_req",
"URL={Location}",
LAST );
// Get HTTP response Code
HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);
} while ((HttpRetCode>=300) & (HttpRetCode<400));
return 0;
}
Handle HTTP Re-Directions in LoadRunner Scripts yourself
http://ptfrontline.wordpress.com/2010/04/11/handle-http-re-directions-in-loadrunner-scripts-yourself/
Action()
{
int HttpRetCode=0;
// Set redirection depth to 0
web_set_option("MaxRedirectionDepth", "0", LAST);
// Initial Location where we want to go
lr_save_string("http://www.mercury.com", "Location");
do
{
// Save new Redirection Info (Location: header)
web_reg_save_param("Location",
"LB=Location: ",
"RB=\r\n",
"Ord=1",
"NotFound=Warning",
"Search=Headers",
LAST );
// do any web call (This needs to be modified to suit your needs)
web_url("my_req",
"URL={Location}",
LAST );
// Get HTTP response Code
HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);
} while ((HttpRetCode>=300) & (HttpRetCode<400));
return 0;
}
相关文章推荐
- 在LoadRunner脚本中处理HTTP重定向
- LoadRunner HTTP脚本迭代处理的常见问题
- loadrunner处理HTTP重定向请求
- LoadRunner HTTP脚本迭代处理的常见问题
- LoadRunner HTTP脚本迭代处理的常见问题
- loadrunner 创建脚本时弹出IE错误处理方法
- 配置scut协议生成器的时候需要配置iis,出现常见错误——Win7中IIS出现“HTTP 错误 404.17 - Not Found 请求的内容似乎是脚本,因而将无法由静态文件处理程序来处理。
- LoadRunner中winsocket协议脚本回放时的mismatch问题处理方法
- Errore HTTP 404.2 - Not Found" IIS 7.5 请求的内容似乎是脚本,因而将无法由静态文件处理程序来处理
- HttpGet和HttpPost处理重定向的区别
- svc 报“由于扩展配置问题而无法提供您请求的页面。如果该页面是脚本,请添加处理程序。如果应下载文件,请添加 MIME 映射。“的HTTP 错误 404.3 – Not Found
- svc 报“由于扩展配置问题而无法提供您请求的页面。如果该页面是脚本,请添加处理程序。如果应下载文件,请添加 MIME 映射。“的HTTP 错误 404.3 – Not Found
- 【转载】HTTP 错误 404.17 - Not Found 请求的内容似乎是脚本,因而将无法由静态文件处理程序来处理
- java网络下载中如何处理http重定向
- LoadRunner录制HTTP脚本问题合集
- HTTP 错误 404.17 - Not Found 请求的内容似乎是脚本,因而将无法由静态文件处理程序来处理
- 基于node-http-proxy的脚本:功能更新,现在支持把GFW屏蔽的URL作快速404失败返回处理;支持把墙外的CDN url映射为本地host
- HTTP 错误 404.3 - Not Found 由于扩展配置问题而无法提供您请求的页面。如果该页面是脚本,请添加处理程序。如果应下载文件,请添加 MIME 映射。
- loadrunner简单使用——HTTP,WebService,Socket压力测试脚本编写
- LoadRunner中winsocket协议脚本回放时的mismatch问题处理方法