|
web_reg_find("Text=Welcome",
"SaveCount=welcome_count",
LAST);
//SaveCount 参数可以记录在缓存中查找内容出现的次数,我们可以使用该值,来判断要查找的内容是否被找到
lr_think_time(13);
web_submit_data("login.pl",
"Action=http://127.0.0.1:1080/WebTours/login.pl",
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value=110707.56508708fzQtfcApDHQVzzzHDtVzHpVcccHf", ENDITEM,
"Name=username", "Value=jojo", ENDITEM,
"Name=password", "Value=bean", ENDITEM,
"Name=JSFormSubmit", "Value=on", ENDITEM,
"Name=login.x", "Value=47", ENDITEM,
"Name=login.y", "Value=5", ENDITEM,
LAST);
//check result
if(atoi(lr_eval_string("{welcome_count}"))>0)
{
//atoi函数将ASCII字符转换为整型,验证是否找到页面上要检查的字符串
lr_output_message("log is successful!");
}
else{
lr_error_message("log is fail!");
return (0);
}
//检查点是在录制的时候加的,回放脚本出现执行else语句,请问是什么问题呢?
//其他网站进行相同操作可以成功找到页面要找的类容,有返回count =1
//replay log : web_reg_find successful for "Text=Welcome" |
|