前兒在網上看到一段用LoadRunner判斷HTTP返回狀態之腳本,覺得很有用処,貼出來大家看。
Action()
...
{
int HttpRetCode;
web_url("www.eis", "URL=http://www.eis/", "Resource=0", "RecContentType=text/html", "Referer=",
"Snapshot=t1.inf", "Mode=HTML", LAST);
HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);
if (HttpRetCode == 200)...{
lr_log_message("成功!");
}else...{
lr_log_message("失敗! ");
}
return 0;
}
int HttpRetCode;
web_url("www.eis", "URL=http://www.eis/", "Resource=0", "RecContentType=text/html", "Referer=",
"Snapshot=t1.inf", "Mode=HTML", LAST);
HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);
if (HttpRetCode == 200)...{
lr_log_message("成功!");
}else...{
lr_log_message("失敗! ");
}
return 0;
}