|
大家好,刚开始学习,我手写了一个简单的登录代码,在运行时抓不到数据包,回放日志里显示登录事务成功了。但同样的登录操作,用录制的方式,回放时是可以抓到数据包的。有人知道是怎么回事吗?为什么手写的抓不到呢,下面是代码,请大家帮忙看一下。谢谢了
ACTION()
{
int HTTPRETCODE;
int i;
web_url("index.php",
"URL=http://10.210.160.142",
"Resource=0",
"Referer=",
LAST);
HTTPRETCODE=web_get_int_property(HTTP_INFO_RETURN_CODE);
if(HTTPRETCODE!=200)
{lr_log_message("open index.php fail:%d", HTTPRETCODE);
lr_exit( LR_EXIT_VUSER,
LR_FAIL );}
web_reg_find("Text=登录成功",
"SaveCount=count",
LAST);
web_submit_data("login",
"Action=http://10.210.160.142/checkuser.php",
"Method=POST",
"Referer=",
ITEMDATA,
"Name=txt_user", "Value=1", ENDITEM,
"Name=txt_pwd", "Value=111", ENDITEM,
"Name=txt_yan", "Value=1", ENDITEM,
"Name=sub_dl", "Value=登录", ENDITEM,
LAST);
if(atoi(lr_eval_string ("{count}"))>0)
{lr_log_message("login success!");lr_end_transaction ("login",LR_PASS);}
else {lr_log_message("login fail");
lr_end_transaction("login", LR_FAIL);
lr_exit( LR_EXIT_VUSER, LR_FAIL );}
return 0;
} |
|