LR录制的一个问题?
我想登陆百度的网页,录制出来的脚本没有web_submit_from函数,我就不知道怎么参数化了。那为同学和老师可以指教一下?/* -------------------------------------------------------------------------------
Script Title :
Script Description :
Recorder Version : 1435
------------------------------------------------------------------------------- */
vuser_init()
{
web_url("www.baidu.com",
"URL=http://www.baidu.com/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t31.inf",
"Mode=HTML",
EXTRARES,
"Url=/js/bdsug.js?v=1.1.0.3", ENDITEM,
LAST);
lr_think_time(4);
web_link("登录",
"Text=登录",
"Snapshot=t32.inf",
EXTRARES,
"Url=/style/login.css?v=1.1", "Referer=http://passport.baidu.com/?login&tpl=mn", ENDITEM,
"Url=/js/login.js?v=1.1", "Referer=http://passport.baidu.com/?login&tpl=mn", ENDITEM,
"Url=/export/login_mn.js", "Referer=http://passport.baidu.com/?login&tpl=mn", ENDITEM,
"Url=/?verifypic", "Referer=http://passport.baidu.com/?login&tpl=mn", ENDITEM,
"Url=http://img.baidu.com/passport/lock.gif", "Referer=http://passport.baidu.com/?login&tpl=mn", ENDITEM,
"Url=http://www.baidu.com/search/images/login/20090722190130tb.jpg", "Referer=http://passport.baidu.com/?login&tpl=mn", ENDITEM,
"Url=http://www.baidu.com/img/logo-yy.gif", "Referer=http://passport.baidu.com/?login&tpl=mn", ENDITEM,
LAST);
lr_think_time(6);
web_url("passport.baidu.com",
"URL=http://passport.baidu.com/?logcheck&username=samadm&t=1251010421171",
"Resource=0",
"RecContentType=text/html",
"Referer=http://passport.baidu.com/?login&tpl=mn",
"Snapshot=t33.inf",
"Mode=HTML",
LAST);
lr_think_time(10);
web_submit_data("passport.baidu.com_2",
"Action=https://passport.baidu.com/?login",
"Method=POST",
"RecContentType=text/html",
"Referer=http://passport.baidu.com/?login&tpl=mn",
"Snapshot=t34.inf",
"Mode=HTML",
ITEMDATA,
"Name=tpl_ok", "Value=", ENDITEM,
"Name=next_target", "Value=", ENDITEM,
"Name=tpl", "Value=mn", ENDITEM,
"Name=skip_ok", "Value=", ENDITEM,
"Name=aid", "Value=", ENDITEM,
"Name=need_pay", "Value=", ENDITEM,
"Name=need_coin", "Value=", ENDITEM,
"Name=pay_method", "Value=", ENDITEM,
"Name=u", "Value=http://www.baidu.com/", ENDITEM,
"Name=return_method", "Value=get", ENDITEM,
"Name=more_param", "Value=", ENDITEM,
"Name=return_type", "Value=", ENDITEM,
"Name=psp_tt", "Value=0", ENDITEM,
"Name=password", "Value=840829", ENDITEM,
"Name=safeflg", "Value=0", ENDITEM,
"Name=username", "Value=samadm", ENDITEM,
"Name=verifycode", "Value=", ENDITEM,
LAST);
web_url("www.baidu.com_2",
"URL=http://www.baidu.com/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t35.inf",
"Mode=HTML",
EXTRARES,
"Url=/js/bdsug_sugtest.js?v=1.1.0.3", ENDITEM,
LAST);
return 0;
} 登陆百度的网页????????
是指什么呢?直接LR打开baidu 还是什么呢?不是很明白 直接用LR打开百度,录制下来的脚本就这样! 你录制协议的问题吧。 你用的是URL协议录制的吧,这样生成web_submit_data函数不会生成web_submit_form
相反HTML协议录制的就生成web_submit_form函数替代web_submit_data 我用的是web(http/html)协议录制,但脚本还是这样啊?这样是对的吗?如果不对,应该是采用什么协议呢? 首先要确定 自己想要什么样的参数化 我想参数化密码和用户名,可不管用什么方法,录制出来的全是web_submit_data。RECORDING OPTIONS 两个选择HTML和URL我都试过,还是web_submit_data。
页:
[1]