|
用loadrunner 自带的预定机票的网站,录制了登录 操作 ,插入了检查点,检查字符串为 "welcome",如果登录成功了,就会出现welcome
代码为:
web_reg_find("Text=Welcome","SaveCount=para_count",LAST);
web_submit_data("login.pl",
"Action=http://127.0.0.1:1080/mercuryWebTours/login.pl",
"Method=POST",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/mercuryWebTours/nav.pl?in=home",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value=102646.565249089fcHQiicpHDVzHQpcQzc", ENDITEM,
"Name=username", "Value=jojo", ENDITEM,
"Name=password", "Value=bean", ENDITEM,
"Name=JSFormSubmit", "Value=off", ENDITEM,
"Name=login.x", "Value=51", ENDITEM,
"Name=login.y", "Value=8", ENDITEM,
LAST);
if(atoi(lr_eval_string("{para_count}"))>0)
lr_output_message("we find the string");
else
lr_output_message("sorry,don't find the sring");
return 0;
} 结果 回放日志里显示的是 sorry,don't find the sring ,哪错了呢? |
|