首页 > 代码库 > 【Loadrunner基础知识】web_get_int_proterty
【Loadrunner基础知识】web_get_int_proterty
1.函数作用:记录http请求的响应信息
2.函数参数:
HTTP_INFO_RETURN_CODE : http请求返回的状态码;
HTTP_INFO_DOWNLOAD_SIZE : 返回页面下载的大小
HTTP_INFO_DOWNLOAD_TIME : 返回页面下载的时间
3.使用位置:用在请求发生的后面。
4.举例:
Action() {
int HttpRetCode ;
int size;
int time;
//http接口访问 web_url("www.baidu.com",
"URL=http://www.baidu.com",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Snapshot=t1.inf",
"Mode=HTML",
LAST );
HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);
size = web_get_int_property(HTTP_INFO_DOWNLOAD_SIZE);
time = web_get_int_property(HTTP_INFO_DOWNLOAD_TIME);
if(HttpRetCode == 200){
lr_log_message("successful"); }else{
lr_log_message("fail");
}
lr_log_message("size is %d",size);
lr_log_message("time is %d",time);
return 0; }
【Loadrunner基础知识】web_get_int_proterty