web_get_int_property(HTTP_INFO_RETURN_CODE)详解(原创)
2011-03-11 16:51
477 查看
近期做一个网站的性能测试,意图想检查每个请求都正常返回。用了web_get_int_property(HTTP_INFO_RETURN_CODE)方法
发现了一些奇怪的现象:
lr_start_transaction("高考政策");
web_url("ZhengCe",
"URL=http://content.21edu.com/GaoKao/XinWen/ZhengCe",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=http://content.21edu.com/",
"Snapshot=t2.inf",
"Mode=HTML",
EXTRARES,
"Url=/Template/21Edu/BinaryResource/Theme/21edu.theme/Images/bg_list_left.gif", ENDITEM,
"Url=/Template/21Edu/BinaryResource/Theme/21edu.theme/images/icon.gif", ENDITEM,
LAST);
HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);
if(HttpRetCode==200){
lr_end_transaction("高考政策", LR_PASS);
}
else
{
lr_end_transaction("高考政策", LR_FAIL);
}
/*高考动态*/
lr_think_time(5);
lr_start_transaction("高考动态");
web_url("DongTai",
"URL=http://content.21edu.com/GaoKao/XinWen/DongTai",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=http://content.21edu.com/GaoKao/XinWen/ZhengCe",
"Snapshot=t3.inf",
"Mode=HTML",
LAST);
HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);
if(HttpRetCode==200){
lr_end_transaction("高考动态", LR_PASS);
}
else
{
lr_end_transaction("高考动态", LR_FAIL);
}
允许结果:
Action.c(62): Notify: Transaction "高考政策" started.
Action.c(64): Resource "http://passport.xueda.com/Scripts/passport.logon.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://images.21edu.com/passport/passport.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Found resource "http://content.21edu.com/Template/21Edu/LayoutTemplate/head.css" in HTML "http://content.21edu.com/GaoKao/XinWen/ZhengCe" [MsgId: MMSG-26659]
Action.c(64): Resource "http://www.21edu.com/scripts/400_phone.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/css/head.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/css/index.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/css/menu.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/css/pagination.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/css/picturn.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/css/tanchu.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/aaaaaaaaajquery.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/autoscroll_pack.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/cityschool.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/easySlider.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/jquery.pagination.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Downloading resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/Images/bg_list_left.gif" (specified by argument number 10) [MsgId: MMSG-26577]
Action.c(64): Downloading resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/images/icon.gif" (specified by argument number 12) [MsgId: MMSG-26577]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/scroller.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/study.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/tabClick.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/texiao.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://images.21edu.com/www/images/logo.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://images.21edu.com/www/images/icon_jt_downhead.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://images.21edu.com/www/js/location_mono.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://images.21edu.com/content/images/bj/ad/gaosan.jpg" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://stat.xueda.com/phpstat/count/abceffgh/abceffgh.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Warning -26627: HTTP Status-Code=404 (Not Found) for "http://content.21edu.com/Template/21Edu/LayoutTemplate/head.css" [MsgId: MWAR-26627]
Action.c(64): web_url("ZhengCe") highest severity level was "warning", 58846 body bytes, 1128 header bytes [MsgId: MMSG-26388]
Action.c(77): web_get_int_property was successful [MsgId: MMSG-26392]
Action.c(79): Notify: Transaction "高考政策" ended with "Pass" status (Duration: 0.8926 Wasted Time: 0.0107).
Action.c(90): Notify: Transaction "高考动态" started.
Action.c(91): Resource "http://passport.xueda.com/Scripts/passport.logon.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://images.21edu.com/passport/passport.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Found resource "http://content.21edu.com/Template/21Edu/LayoutTemplate/head.css" in HTML "http://content.21edu.com/GaoKao/XinWen/DongTai" [MsgId: MMSG-26659]
Action.c(91): Resource "http://www.21edu.com/scripts/400_phone.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/css/head.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/css/index.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/css/menu.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/css/pagination.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/css/picturn.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/css/tanchu.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/aaaaaaaaajquery.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/autoscroll_pack.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/cityschool.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/easySlider.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/jquery.pagination.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/scroller.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/study.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/tabClick.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/texiao.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://images.21edu.com/www/images/logo.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://images.21edu.com/www/images/icon_jt_downhead.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://images.21edu.com/www/js/location_mono.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://images.21edu.com/content/images/bj/ad/gaosan.jpg" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://stat.xueda.com/phpstat/count/abceffgh/abceffgh.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Warning -26627: HTTP Status-Code=404 (Not Found) for "http://content.21edu.com/Template/21Edu/LayoutTemplate/head.css" [MsgId: MWAR-26627]
Action.c(91): web_url("DongTai") highest severity level was "warning", 26860 body bytes, 520 header bytes [MsgId: MMSG-26388]
Action.c(100): web_get_int_property was successful [MsgId: MMSG-26392]
Action.c(106): Notify: Transaction "高考动态" ended with "Fail" status (Duration: 1.0974 Wasted Time: 0.0044).
两个web_url请求中服务器返回结果中都有HTTP Status-Code=404但是从事务结果看 前面一个是成功,后面一个是失败的。(纳闷吧)
接下来吧 上面代码第一个web_url修改下
lr_start_transaction("高考政策");
web_url("ZhengCe",
"URL=http://content.21edu.com/GaoKao/XinWen/ZhengCe",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=http://content.21edu.com/",
"Snapshot=t2.inf",
"Mode=HTML",
LAST);
//把请求附属资源去掉
//EXTRARES,
//"Url=/Template/21Edu/BinaryResource/Theme/21edu.theme/Images/bg_list_left.gif", ENDITEM,
//"Url=/Template/21Edu/BinaryResource/Theme/21edu.theme/images/icon.gif", ENDITEM,
HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);
if(HttpRetCode==200){
lr_end_transaction("高考政策", LR_PASS);
}
else
{
lr_end_transaction("高考政策", LR_FAIL);
}
看运行结果:
Action.c(64): Resource "http://stat.xueda.com/phpstat/count/abceffgh/abceffgh.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Warning -26627: HTTP Status-Code=404 (Not Found) for "http://content.21edu.com/Template/21Edu/LayoutTemplate/head.css" [MsgId: MWAR-26627]
Action.c(64): web_url("ZhengCe") highest severity level was "warning", 26896 body bytes, 520 header bytes [MsgId: MMSG-26388]
Action.c(73): web_get_int_property was successful [MsgId: MMSG-26392]
Action.c(83): Notify: Transaction "高考政策" ended with "Fail" status (Duration: 0.9543 Wasted Time: 0.0040).
这次跟第二个事务一样 事务失败。
这个方法 如果事务里头包含多个请求,建议不要用,因为他返回的值 是最后一个接收到响应头里的状态码。
HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE)
Note:
The web_get_int_property function only captures the last status code that was received. If there is a redirection in between, it is not reflected. To get all of the responses, you can use the web_reg_save_param function with:
发现了一些奇怪的现象:
lr_start_transaction("高考政策");
web_url("ZhengCe",
"URL=http://content.21edu.com/GaoKao/XinWen/ZhengCe",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=http://content.21edu.com/",
"Snapshot=t2.inf",
"Mode=HTML",
EXTRARES,
"Url=/Template/21Edu/BinaryResource/Theme/21edu.theme/Images/bg_list_left.gif", ENDITEM,
"Url=/Template/21Edu/BinaryResource/Theme/21edu.theme/images/icon.gif", ENDITEM,
LAST);
HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);
if(HttpRetCode==200){
lr_end_transaction("高考政策", LR_PASS);
}
else
{
lr_end_transaction("高考政策", LR_FAIL);
}
/*高考动态*/
lr_think_time(5);
lr_start_transaction("高考动态");
web_url("DongTai",
"URL=http://content.21edu.com/GaoKao/XinWen/DongTai",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=http://content.21edu.com/GaoKao/XinWen/ZhengCe",
"Snapshot=t3.inf",
"Mode=HTML",
LAST);
HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);
if(HttpRetCode==200){
lr_end_transaction("高考动态", LR_PASS);
}
else
{
lr_end_transaction("高考动态", LR_FAIL);
}
允许结果:
Action.c(62): Notify: Transaction "高考政策" started.
Action.c(64): Resource "http://passport.xueda.com/Scripts/passport.logon.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://images.21edu.com/passport/passport.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Found resource "http://content.21edu.com/Template/21Edu/LayoutTemplate/head.css" in HTML "http://content.21edu.com/GaoKao/XinWen/ZhengCe" [MsgId: MMSG-26659]
Action.c(64): Resource "http://www.21edu.com/scripts/400_phone.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/css/head.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/css/index.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/css/menu.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/css/pagination.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/css/picturn.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/css/tanchu.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/aaaaaaaaajquery.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/autoscroll_pack.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/cityschool.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/easySlider.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/jquery.pagination.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Downloading resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/Images/bg_list_left.gif" (specified by argument number 10) [MsgId: MMSG-26577]
Action.c(64): Downloading resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/images/icon.gif" (specified by argument number 12) [MsgId: MMSG-26577]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/scroller.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/study.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/tabClick.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/texiao.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://images.21edu.com/www/images/logo.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://images.21edu.com/www/images/icon_jt_downhead.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://images.21edu.com/www/js/location_mono.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://images.21edu.com/content/images/bj/ad/gaosan.jpg" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Resource "http://stat.xueda.com/phpstat/count/abceffgh/abceffgh.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Warning -26627: HTTP Status-Code=404 (Not Found) for "http://content.21edu.com/Template/21Edu/LayoutTemplate/head.css" [MsgId: MWAR-26627]
Action.c(64): web_url("ZhengCe") highest severity level was "warning", 58846 body bytes, 1128 header bytes [MsgId: MMSG-26388]
Action.c(77): web_get_int_property was successful [MsgId: MMSG-26392]
Action.c(79): Notify: Transaction "高考政策" ended with "Pass" status (Duration: 0.8926 Wasted Time: 0.0107).
Action.c(90): Notify: Transaction "高考动态" started.
Action.c(91): Resource "http://passport.xueda.com/Scripts/passport.logon.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://images.21edu.com/passport/passport.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Found resource "http://content.21edu.com/Template/21Edu/LayoutTemplate/head.css" in HTML "http://content.21edu.com/GaoKao/XinWen/DongTai" [MsgId: MMSG-26659]
Action.c(91): Resource "http://www.21edu.com/scripts/400_phone.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/css/head.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/css/index.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/css/menu.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/css/pagination.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/css/picturn.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Theme/21edu.theme/css/tanchu.css" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/aaaaaaaaajquery.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/autoscroll_pack.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/cityschool.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/easySlider.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/jquery.pagination.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/scroller.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/study.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/tabClick.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://content.21edu.com/Template/21Edu/BinaryResource/Javascript/texiao.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://images.21edu.com/www/images/logo.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://images.21edu.com/www/images/icon_jt_downhead.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://images.21edu.com/www/js/location_mono.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://images.21edu.com/content/images/bj/ad/gaosan.jpg" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Resource "http://stat.xueda.com/phpstat/count/abceffgh/abceffgh.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(91): Warning -26627: HTTP Status-Code=404 (Not Found) for "http://content.21edu.com/Template/21Edu/LayoutTemplate/head.css" [MsgId: MWAR-26627]
Action.c(91): web_url("DongTai") highest severity level was "warning", 26860 body bytes, 520 header bytes [MsgId: MMSG-26388]
Action.c(100): web_get_int_property was successful [MsgId: MMSG-26392]
Action.c(106): Notify: Transaction "高考动态" ended with "Fail" status (Duration: 1.0974 Wasted Time: 0.0044).
两个web_url请求中服务器返回结果中都有HTTP Status-Code=404但是从事务结果看 前面一个是成功,后面一个是失败的。(纳闷吧)
接下来吧 上面代码第一个web_url修改下
lr_start_transaction("高考政策");
web_url("ZhengCe",
"URL=http://content.21edu.com/GaoKao/XinWen/ZhengCe",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=http://content.21edu.com/",
"Snapshot=t2.inf",
"Mode=HTML",
LAST);
//把请求附属资源去掉
//EXTRARES,
//"Url=/Template/21Edu/BinaryResource/Theme/21edu.theme/Images/bg_list_left.gif", ENDITEM,
//"Url=/Template/21Edu/BinaryResource/Theme/21edu.theme/images/icon.gif", ENDITEM,
HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);
if(HttpRetCode==200){
lr_end_transaction("高考政策", LR_PASS);
}
else
{
lr_end_transaction("高考政策", LR_FAIL);
}
看运行结果:
Action.c(64): Resource "http://stat.xueda.com/phpstat/count/abceffgh/abceffgh.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(64): Warning -26627: HTTP Status-Code=404 (Not Found) for "http://content.21edu.com/Template/21Edu/LayoutTemplate/head.css" [MsgId: MWAR-26627]
Action.c(64): web_url("ZhengCe") highest severity level was "warning", 26896 body bytes, 520 header bytes [MsgId: MMSG-26388]
Action.c(73): web_get_int_property was successful [MsgId: MMSG-26392]
Action.c(83): Notify: Transaction "高考政策" ended with "Fail" status (Duration: 0.9543 Wasted Time: 0.0040).
这次跟第二个事务一样 事务失败。
这个方法 如果事务里头包含多个请求,建议不要用,因为他返回的值 是最后一个接收到响应头里的状态码。
HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE)
Note:
The web_get_int_property function only captures the last status code that was received. If there is a redirection in between, it is not reflected. To get all of the responses, you can use the web_reg_save_param function with:
相关文章推荐
- lr函数--web_get_int_property(记录HTTP响应信息)
- LoadRunner总结(1)-web_get_int_property 函数
- LoadRunner-使用web_get_int_property进行文件下载
- cxf /webservice出错 org.apache.cxf.interceptor.Fault: No such operation: (HTTP GET PATH_INFO: /CxfDem
- lr函数--web_get_int_property
- lr函数--web_get_int_property
- loadrunner Web_类函数之web_get_int_property()
- lr函数--web_get_int_property返回上一级请求的状态
- web_get_int_property 两种不同参数
- HttpWebRequest.GetResponse() raises exception when http status code 400 (bad request) is returned
- LoadRunner functions 之web_get_int_property_ 验证页面通过, 页面下载, 事物成功_xyb
- HTTP POST GET SOAP本质区别详解
- 如何正确的为web.config编写http error code的自定义页面
- WebService报错: No such operation: (HTTP GET PATH_INFO: /flexcc/flexccService/flexccApp)
- HTTP请求方式GET和POST的区别详解
- HttpWebRequest中GetResponse或者说GetRequestStream偶尔超时,或者是各种操作超时造成的假死的一些解决方案
- HTTP协议状态码详解(HTTP Status Code)(转)
- 数据库-mysql--IP address 'xxx.xxx.xxx.xx' could not be resolved: getnameinfo() returned error (code: -3
- go get报错 error: RPC failed; result=56, HTTP code =
- HTTP协议状态码详解(HTTP Status Code)