|
录制一段登录脚本,在录制选项-关联中选择在脚本中自动建立关联,脚本如下
#include "as_web.h"
Action()
{
web_set_max_html_param_len("1024");
web_url("login.aspx",
"URL=http://localhost/bms/login.aspx",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"Url=images/login_message_back.gif", ENDITEM,
"Url=images/hline.gif", ENDITEM,
LAST);
/* Registering parameter(s) from source task id 15
// {Siebel_Analytic_ViewState3} = "dDwyMDIyOTgwODAyOzs+9dZASwN2xnttMrh5wlXhK3xRXFE="
// */
web_reg_save_param("Siebel_Analytic_ViewState3",
"LB/IC=ViewState\" value=\"",
"RB/IC=\"",
"Ord=1",
"Search=Body",
"RelFrameId=1.1",
LAST);
web_submit_form("login.aspx_2",
"Snapshot=t2.inf",
ITEMDATA,
"Name=tbname", "Value={cc}", ENDITEM,
"Name=tbpassword", "Value={dd}", ENDITEM,
"Name=btlogin", "Value=登 陆", ENDITEM,
EXTRARES,
"Url=resource/style.css", "Referer=http://localhost/bms/default.htm", ENDITEM,
"Url=../webctrl_client/1_0/treeview.htc", "Referer=", ENDITEM,
"Url=../webctrl_client/1_0/treeimages/F.gif", "Referer=http://localhost/bms/power.aspx", ENDITEM,
"Url=../webctrl_client/1_0/treeimages/Tplus.gif", "Referer=http://localhost/bms/power.aspx", ENDITEM,
"Url=../webctrl_client/1_0/treeimages/Lplus.gif", "Referer=http://localhost/bms/power.aspx", ENDITEM,
LAST);
web_submit_data("top.aspx",
"Action=http://localhost/bms/top.aspx",
"Method=POST",
"RecContentType=text/html",
"Referer=http://localhost/bms/top.aspx",
"Snapshot=t3.inf",
"Mode=HTML",
ITEMDATA,
"Name=__EVENTTARGET", "Value=lbtlogout", ENDITEM,
"Name=__EVENTARGUMENT", "Value=", ENDITEM,
"Name=__VIEWSTATE", "Value={Siebel_Analytic_ViewState3}", ENDITEM,
LAST);
web_url("login.aspx_3",
"URL=http://localhost/bms/login.aspx",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t4.inf",
"Mode=HTML",
EXTRARES,
"Url=images/login_message_back.gif", ENDITEM,
"Url=images/hline.gif", ENDITEM,
LAST);
return 0;
}
其中对用户名进行了参数化,提示出错
Action.c(31): 错误 -27190: 找不到请求的参数“Siebel_Analytic_ViewState3”的匹配项。检查请求的边界是否存在于响应数据中。此外,如果要保存的数据超过 1024 个字节,请使用 web_set_max_html_param_len 增加参数大小 [MsgId: MERR-27190]
结束自动日志消息堆栈。
时什么原因?关联的问题吗? |
|