|
作为新手,我要碰到这个坑, 按照其说明,加了关联session的代码,就回放成功了, 供参考:
Action()
{
web_reg_save_param("web_session", //add a the web_seesion to record the session value
"LB=name=userSession value=",
"RB=>",
"Ord=1",
"Search=body",
LAST);
web_url("WebTours",
"URL=http://127.0.0.1:1080/WebTours/",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t4.inf",
"Mode=HTML",
LAST);
lr_think_time(8);
web_submit_data("login.pl",
"Action=http://127.0.0.1:1080/WebTours/login.pl",
"Method=POST",
"TargetFrame=body",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home",
"Snapshot=t5.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value={web_session}", ENDITEM, //here we use the web_session param
"Name=username", "Value=admin", ENDITEM,
"Name=password", "Value=admin", ENDITEM,
"Name=JSFormSubmit", "Value=off", ENDITEM,
"Name=login.x", "Value=58", ENDITEM,
"Name=login.y", "Value=9", ENDITEM,
LAST);
web_reg_find("Text=pansc", LAST ); //check whether the login process is successful or failed.
lr_think_time(10);
web_url("SignOff Button",
"URL=http://127.0.0.1:1080/WebTours/welcome.pl?signOff=1",
"TargetFrame=body",
"Resource=0",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home",
"Snapshot=t6.inf",
"Mode=HTML",
LAST);
return 0;
}
|
|