在lr中录制脚本后,设置检查点,反复两次,第一次失败
在lr中录制脚本后,设置检查点,检查首页上的文字。设置action反复两次,第一次反复时总是失败,总是error,
"web_find" failed. 0 occurrence(s) of "sa" found (RightOf="", LeftOf="")
Action.c(67): web_find highest severity level was "ERROR"
第二次反复时,检查结果为successful。用web_find 和web_reg_find都不行,是哪的原因? 是不是你录制网站的时候有关联信息呀? 请问楼上是怎么想到关联的问题的?
麻烦楼主把检查点那一段脚本贴上来一下
代码附上
Action(){
web_add_cookie("sa=admin; DOMAIN=192.168.0.24");
web_add_cookie("Bugzilla_login=1; DOMAIN=192.168.0.24");
web_add_cookie("Bugzilla_logincookie=6; DOMAIN=192.168.0.24");
web_set_max_html_param_len("1024");
/* Registering parameter(s) from source task id 4
// {JSESSIONID2} = "17843EEF4F0AF02D4BC0C4C874F301CC"
// */
web_reg_save_param("JSESSIONID2",
"LB/IC=jsessionid=",
"RB/IC=\"",
"Ord=1",
"RelFrameId=1",
"Search=body",
LAST);
web_url("bx",
"URL=http://192.168.0.24:8080/bx",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"URL=/bx/image/5-12.gif", "Referer=http://192.168.0.24:8080/bx/login.jsp", ENDITEM,
"URL=/bx/image/6-12.gif", "Referer=http://192.168.0.24:8080/bx/login.jsp", ENDITEM,
LAST);
lr_think_time(29);
lr_start_transaction("login");
lr_think_time(11);
lr_rendezvous("loginrende");
web_submit_data("logonNew.do;jsessionid=17843EEF4F0AF02D4BC0C4C874F301CC",
"Action=http://192.168.0.24:8080/bx/logonNew.do;jsessionid={JSESSIONID2}",
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://192.168.0.24:8080/bx/login.jsp",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=logonName", "Value={usename}", ENDITEM,
"Name=encryptName", "Value={usename}", ENDITEM,
EXTRARES,
"URL=image/maintop.jpg", "Referer=http://192.168.0.24:8080/bx/flow/prepareIndex.do", ENDITEM,
"URL=image/mainbuttom.jpg", "Referer=http://192.168.0.24:8080/bx/flow/prepareIndex.do", ENDITEM,
LAST);
lr_think_time(20);
web_find("web_find",
"What=sa",
LAST);
lr_output_message("loginname is:%s", lr_eval_string("usename}"));
lr_end_transaction("login", LR_AUTO);
lr_think_time(7);
web_url("退出系统",
"URL=http://192.168.0.24:8080/bx/logOff.do",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t3.inf",
"Mode=HTML",
EXTRARES,
"URL=image/5-12.gif", ENDITEM,
"URL=image/6-12.gif", ENDITEM,
LAST);
return 0;
} 我也想知道,帮你顶一下 jsessionid=17843EEF4F0AF02D4BC0C4C874F301CC
是不是这个 web_find("web_find",
"What=sa",
LAST);
是不是应该放在web_submit_data以前?? 原帖由 lingxdbc 于 2008-11-3 11:42 发表 http://bbs.51testing.com/images/common/back.gif
web_find("web_find",
"What=sa",
LAST);
是不是应该放在web_submit_data以前??
放后面 哦对,web_reg_find才是放前面.....
想看看replay_log 里记录的web_reg_save_param 的值
这个答案已经找到
是因为参数化的问题。密码参数化也用了usename,所以出错了,因为第一次登录失败。第二次登录成功。 我们想太多了 要注意"same line as"啊
页:
[1]