---
title: "是如何利用LoadRunner判断HTTP服务器的返回状态. "
author: "lunrain"
date: "2012-12-17T09:41:29Z"
tags: []
categories: ["行业应用"]
slug: "loadrunner-http"
draft: false
lastmod: "2012-12-17T09:41:29Z"
id: 1748831
url: "https://lunrain.iteye.com/blog/1748831"
---

第一种方法是利用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 “);
}
