是如何利用LoadRunner判断HTTP服务器的返回状态. 博客分类: 01-loadrunner场景部分经验总结 ITperformance
程序员文章站
2024-02-06 11:38:40
...
第一种方法是利用LR的内置函数web_get_int_property, 如下是一个简单的例子:
Action.c
{
int HttpRetCode;
web_url(”my_home”, “URL=http://my_home”, “TargetFrame=_TOP”, LAST);
HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);
if (HttpRetCode == 200)
lr_log_message(”The script. successfully accessed the My_home home page”);
else
lr_log_message(”The script. failed to access the My_home home page “);
}
Action.c
{
int HttpRetCode;
web_url(”my_home”, “URL=http://my_home”, “TargetFrame=_TOP”, LAST);
HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);
if (HttpRetCode == 200)
lr_log_message(”The script. successfully accessed the My_home home page”);
else
lr_log_message(”The script. failed to access the My_home home page “);
}