|
为什么我的脚本不用关联也可以回放成功呢?
我做的对一个系统的登陆操作,登陆成功后会提示“欢迎XXX”,录制脚本的时候取消勾选自动关联项。
完成后的脚本中确实可以看到有jession的动态变换数字,但我没有进行手动关联,利用web_reg_find进行验证“欢迎XXX”,居然提示成功了,真是百思不得其解,往能够想通的朋友帮我解释一下,多谢!
以下是我这段的脚本:
Action()
{
web_reg_find("Search=Body",
"SaveCount=result_open",
"Text=用户名", //打开的登陆页中有"用户名"
LAST);
web_url("welcome",
"URL=http://192.168.2.22:8080/lighting/kingdee_web/welcome",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"URL=../resources/css/layout.css", "Referer=http://192.168.2.22:8080/lighting/login.jsp;jsessionid=2F838842765542243A7B8ED3FCF3DBFD", ENDITEM,
"URL=../resources/images/login.jpg", "Referer=http://192.168.2.22:8080/lighting/login.jsp;jsessionid=2F838842765542243A7B8ED3FCF3DBFD", ENDITEM,
"URL=../resources/images/login_input.gif", "Referer=http://192.168.2.22:8080/lighting/login.jsp;jsessionid=2F838842765542243A7B8ED3FCF3DBFD", ENDITEM,
"URL=/favicon.ico", ENDITEM,
LAST);
if(atoi(lr_eval_string("{result_open}"))>0)
{
lr_output_message("open the url successful!");
}
else
{
lr_error_message("open the url failed");
}
web_reg_find("Text=超级管理员", //录制脚本时以超级管理员登陆,登陆成功后的界面中有“超级管理员”
"SaveCount=loginresult1",
"Search=Body",
LAST);
web_submit_form("j_spring_security_check",
"Snapshot=t2.inf",
ITEMDATA,
"Name=j_username", "Value=super", ENDITEM,
"Name=j_password", "Value=zmj", ENDITEM,
EXTRARES,
"URL=resources/images/logo_shadow.gif", "Referer=http://192.168.2.22:8080/lighting/jsp/main.jsp", ENDITEM,
"URL=resources/css/themes/redmond/jquery.ui.theme.css", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/css/themes/redmond/jquery.ui.base.css", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/css/themes/redmond/jquery.ui.core.css", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/css/themes/redmond/jquery.ui.resizable.css", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/css/themes/redmond/jquery.ui.accordion.css", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/css/themes/redmond/jquery.ui.button.css", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/css/themes/redmond/jquery.ui.autocomplete.css", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/css/themes/redmond/jquery.ui.datepicker.css", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/css/themes/redmond/jquery.ui.slider.css", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/css/themes/redmond/jquery.ui.dialog.css", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/css/themes/redmond/jquery.ui.selectable.css", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/css/themes/redmond/jquery.ui.tabs.css", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/css/themes/redmond/jquery.ui.progressbar.css", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/images/LeftBgImg.png", "Referer=http://192.168.2.22:8080/lighting/jsp/left.jsp", ENDITEM,
"URL=resources/js/my97/skin/WdatePicker.css", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/css/images/default/panel/white-top-bottom.gif", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/css/images/System/TopBgImg.png", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/css/images/System/TopBgImg2.png", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/css/images/System/TopButtonBg.png", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/images/10.png", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/images/16.png", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/images/60.png", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/images/88.png", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/images/65.png", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/images/26.png", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/images/68.png", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/images/34.png", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/images/OA.png", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
"URL=resources/css/images/System/TopButtonBg2.png", "Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp", ENDITEM,
LAST);
if(atoi(lr_eval_string("{loginresult1}"))>0)
{
lr_output_message("login successful!");
}
else
{
lr_error_message("Log on failed");
}
web_url("My97DatePicker.htm",
"URL=http://192.168.2.22:8080/lighting/resources/js/my97/My97DatePicker.htm",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp",
"Snapshot=t3.inf",
"Mode=HTML",
EXTRARES,
"URL=skin/whyGreen/datepicker.css", ENDITEM,
"URL=lang/zh-cn.js", ENDITEM,
"URL=skin/default/datepicker.css", ENDITEM,
"URL=skin/default/img.gif", ENDITEM,
LAST);
web_url("getFunction",
"URL=http://192.168.2.22:8080/lighting/kingdee_json/menu/getFunction?id=select%20ROLE_ID%20from%20role&_dt=1330588826764&_=1330588826764",
"Resource=0",
"Referer=http://192.168.2.22:8080/lighting/jsp/top.jsp",
"Snapshot=t4.inf",
"Mode=HTML",
LAST);
web_url("left.jsp",
"URL=http://192.168.2.22:8080/lighting/jsp/left.jsp",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.2.22:8080/lighting/kingdee_web/welcome",
"Snapshot=t5.inf",
"Mode=HTML",
EXTRARES,
"URL=../resources/css/layout.css", ENDITEM,
"URL=../resources/images/LeftBgImg.png", ENDITEM,
"URL=../resources/images/function1.png", ENDITEM,
"URL=../resources/css/images/System/LeftBgImg3.gif", ENDITEM,
"URL=../resources/images/function2.png", ENDITEM,
LAST);
web_url("main.jsp",
"URL=http://192.168.2.22:8080/lighting/jsp/main.jsp",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.2.22:8080/lighting/kingdee_web/welcome",
"Snapshot=t6.inf",
"Mode=HTML",
LAST);
web_url("load",
"URL=http://192.168.2.22:8080/lighting/kingdee_json/menu/load?id=34&_dt=1330588827718&_=1330588827718",
"Resource=0",
"Referer=http://192.168.2.22:8080/lighting/jsp/left.jsp",
"Snapshot=t7.inf",
"Mode=HTML",
LAST);
以下是回放时日志信息中的一部分:
Action.c(24): open the url successful!
。。。
login successful! |
|