loadrunner检查点的问题
假定有2个帐户,分别是999 abc999是正确的账号,可以正常登陆
abc是不存在的帐户
迭代2次。
现在的原因是如果先登陆abc 会提示登陆失败,然后运行999提示登陆成功
如果先登陆999 那999和abc 2个帐户都会提示登陆成功。
有人知道原因吗
如果是三个账号 abc 000999 abc
那么第一次迭代abc失败然后000999提示登陆成功然后abc也提示成功
我的判定机制是 通过文本检查点的次数
如果为1 表示检查到了 提示登陆成功
如果为0 没有找到 则提示登陆失败
部分手工代码如下
lr_log_message("用户名:%s", lr_eval_string("{username}")); /* username为参数化名称*/
lr_log_message("%s", lr_eval_string("{num}")); /* num为检查点检查次数*/
if (strcmp(lr_eval_string ("{num}"),"0")==0)
lr_log_message("登陆失败");
else
lr_log_message("登陆成功");
[ 本帖最后由 裸奔的蜗牛 于 2009-12-14 15:45 编辑 ]
代码如下 vuser_init()
/* -------------------------------------------------------------------------------Script Title :
Script Description :
Recorder Version : 1196
------------------------------------------------------------------------------- */
vuser_init()
{
web_url("emr",
"URL=http://192.168.88.29:8080/emr/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
web_add_cookie("gonum=0; DOMAIN=192.168.88.29");
web_url("index.jsp",
"URL=http://192.168.88.29:8080/emr/emr/index.jsp?menu_sys=emr",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t2.inf",
"Mode=HTML",
EXTRARES,
"Url=images/login_bg.jpg", "Referer=http://192.168.88.29:8080/emr/emr/index.jsp?menu_sys=emr", ENDITEM,
LAST);
lr_think_time(4);
web_custom_request("ajaxdo2.do",
"URL=http://192.168.88.29:8080/emr/ajaxdo2.do?TMP_CDE=",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.88.29:8080/emr/emr/index.jsp?menu_sys=emr",
"Snapshot=t3.inf",
"Mode=HTML",
"EncType=",
LAST);
return 0;
}
login1()
login1(){
lr_think_time(9);
web_custom_request("ajaxdo2.do_2",
"URL=http://192.168.88.29:8080/emr/ajaxdo2.do?TMP_CDE=999",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.88.29:8080/emr/emr/index.jsp?menu_sys=emr",
"Snapshot=t4.inf",
"Mode=HTML",
"EncType=",
EXTRARES,
"Url=images/login_in.png", "Referer=http://192.168.88.29:8080/emr/emr/index.jsp?menu_sys=emr", ENDITEM,
LAST);
web_submit_data("login.do",
"Action=http://192.168.88.29:8080/emr/login.do",
"Method=POST",
"RecContentType=text/html",
"Referer=http://192.168.88.29:8080/emr/emr/index.jsp?menu_sys=emr",
"Snapshot=t5.inf",
"Mode=HTML",
ITEMDATA,
"Name=user_id", "Value={username}", ENDITEM,
"Name=user_password", "Value=1", ENDITEM,
"Name=screenY", "Value=721", ENDITEM,
"Name=screenX", "Value=1270", ENDITEM,
"Name=menu_sys", "Value=emr", ENDITEM,
"Name=commit_reg.x", "Value=56", ENDITEM,
"Name=commit_reg.y", "Value=14", ENDITEM,
LAST);
web_url("EMR_menu.jsp",
"URL=http://192.168.88.29:8080/emr/emr/EMR_menu.jsp",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t6.inf",
"Mode=HTML",
EXTRARES,
"Url=../sysimage/panel2.JPG", ENDITEM,
"Url=../sysimage/navg.gif", ENDITEM,
"Url=../sysimage/tab_right_on.gif", ENDITEM,
"Url=../images/topbgd02.jpg", "Referer=http://192.168.88.29:8080/emr/emr/topmain.jsp", ENDITEM,
"Url=../images/topbgd2.jpg", "Referer=http://192.168.88.29:8080/emr/emr/topmain.jsp", ENDITEM,
"Url=../sysimage/tab_left_on.gif", ENDITEM,
"Url=../images/mainbj.jpg", "Referer=http://192.168.88.29:8080/emr/emr/default1.jsp", ENDITEM,
"Url=images/link04.png", "Referer=", ENDITEM,
LAST);
return 0;
}
login2()
login2(){
lr_think_time(11);
web_url("closeAll.gif",
"URL=http://192.168.88.29:8080/emr/sysimage/closeAll.gif",
"Resource=1",
"RecContentType=image/gif",
"Referer=http://192.168.88.29:8080/emr/emr/EMR_menu.jsp",
"Snapshot=t7.inf",
LAST);
web_url("tab_left.gif",
"URL=http://192.168.88.29:8080/emr/sysimage/tab_left.gif",
"Resource=1",
"RecContentType=image/gif",
"Referer=http://192.168.88.29:8080/emr/emr/EMR_menu.jsp",
"Snapshot=t8.inf",
LAST);
web_url("tab_right.gif",
"URL=http://192.168.88.29:8080/emr/sysimage/tab_right.gif",
"Resource=1",
"RecContentType=image/gif",
"Referer=http://192.168.88.29:8080/emr/emr/EMR_menu.jsp",
"Snapshot=t9.inf",
LAST);
web_url("tab_left.gif_2",
"URL=http://192.168.88.29:8080/emr/sysimage/tab_left.gif",
"Resource=1",
"RecContentType=image/gif",
"Referer=http://192.168.88.29:8080/emr/emr/EMR_menu.jsp",
"Snapshot=t10.inf",
LAST);
web_url("login.jsp",
"URL=http://192.168.88.29:8080/emr/emr/opd/login.jsp?MENUID=472¬ename=notet1&tname=t1",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.88.29:8080/emr/emr/EMR_menu.jsp",
"Snapshot=t11.inf",
"Mode=HTML",
EXTRARES,
"URL=../images/opdbg.jpg", "Referer=http://192.168.88.29:8080/emr/emr/opd/login.jsp?MENUID=472¬ename=notet1&tname=t1", ENDITEM,
LAST);
web_custom_request("ajaxdo.do",
"URL=http://192.168.88.29:8080/emr/ajaxdo.do?dotype=1&code=000999",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.88.29:8080/emr/emr/opd/login.jsp?MENUID=472¬ename=notet1&tname=t1",
"Snapshot=t12.inf",
"Mode=HTML",
"EncType=",
LAST);
web_custom_request("ajaxdo2.do_3",
"URL=http://192.168.88.29:8080/emr/ajaxdo2.do?TMP_CDE=000999",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.88.29:8080/emr/emr/opd/login.jsp?MENUID=472¬ename=notet1&tname=t1",
"Snapshot=t13.inf",
"Mode=HTML",
"EncType=",
LAST);
web_custom_request("ajaxdo.do_2",
"URL=http://192.168.88.29:8080/emr/ajaxdo.do?dotype=1&code=000999",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.88.29:8080/emr/emr/opd/login.jsp?MENUID=472¬ename=notet1&tname=t1",
"Snapshot=t14.inf",
"Mode=HTML",
"EncType=",
LAST);
lr_think_time(4);
web_custom_request("ajaxdo.do_3",
"URL=http://192.168.88.29:8080/emr/ajaxdo.do?dotype=2&code=1125",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.88.29:8080/emr/emr/opd/login.jsp?MENUID=472¬ename=notet1&tname=t1",
"Snapshot=t15.inf",
"Mode=HTML",
"EncType=",
LAST);
web_submit_data("opd_login.do",
"Action=http://192.168.88.29:8080/emr/opd_login.do",
"Method=POST",
"RecContentType=text/html",
"Referer=http://192.168.88.29:8080/emr/emr/opd/login.jsp?MENUID=472¬ename=notet1&tname=t1",
"Snapshot=t16.inf",
"Mode=HTML",
ITEMDATA,
"Name=MASH_IP", "Value=192.168.88.210", ENDITEM,
"Name=oei_type", "Value=O", ENDITEM,
"Name=user_id", "Value=000999", ENDITEM,
"Name=userpwd", "Value=1", ENDITEM,
"Name=usr_nm", "Value=应镇江", ENDITEM,
"Name=div_cde", "Value=1125", ENDITEM,
"Name=div_nm", "Value=骨科", ENDITEM,
"Name=MED_TEAM_CDE", "Value=", ENDITEM,
"Name=OPD_AREA", "Value=1", ENDITEM,
"Name=LOGIN_ROOM", "Value=1", ENDITEM,
"Name=Submit1", "Value= 登 陆 ", ENDITEM,
LAST);
web_add_cookie("gonum=12; DOMAIN=192.168.88.29");
/*web_reg_find("Text=新看诊记录",
"SaveCount=num",
"Search=body",
LAST);*/
web_reg_find("Text=你好:应镇江","SaveCount=num", "Search=body",LAST);
web_url("msgzz.jsp",
"URL=http://192.168.88.29:8080/emr/emr/opd/msgzz.jsp?loginid=13919",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.88.29:8080/emr/emr/EMR_menu.jsp",
"Snapshot=t17.inf",
"Mode=HTML",
EXTRARES,
"URL=/emr/HtmSourse/ucren-widgets/common/skins/lv2/interface.css", "Referer=http://192.168.88.29:8080/emr/emr/opd/msgzz.jsp?loginid=13919", ENDITEM,
"URL=/emr/sysimage/1leftm1.gif", "Referer=http://192.168.88.29:8080/emr/emr/opd/msgzz.jsp?loginid=13919", ENDITEM,
"URL=/emr/HtmSourse/ucren-widgets/common/skins/lv2/win-point.gif", "Referer=http://192.168.88.29:8080/emr/emr/opd/msgzz.jsp?loginid=13919", ENDITEM,
"URL=/emr/HtmSourse/ucren-widgets/common/skins/lv2/win-tit.gif", "Referer=http://192.168.88.29:8080/emr/emr/opd/msgzz.jsp?loginid=13919", ENDITEM,
"URL=/emr/HtmSourse/ucren-widgets/common/skins/lv2/win-bd.gif", "Referer=http://192.168.88.29:8080/emr/emr/opd/msgzz.jsp?loginid=13919", ENDITEM,
"URL=/emr/HtmSourse/ucren-widgets/common/skins/lv2/win-tb.gif", "Referer=http://192.168.88.29:8080/emr/emr/opd/msgzz.jsp?loginid=13919", ENDITEM,
"URL=/emr/HtmSourse/ucren-widgets/common/skins/lv2/win-lr.gif", "Referer=http://192.168.88.29:8080/emr/emr/opd/msgzz.jsp?loginid=13919", ENDITEM,
"URL=/emr/HtmSourse/ucren-widgets/common/skins/lv2/win-resbar.gif", "Referer=http://192.168.88.29:8080/emr/emr/opd/msgzz.jsp?loginid=13919", ENDITEM,
"URL=/emr/sysimage/2gradient_tcat.gif", "Referer=http://192.168.88.29:8080/emr/emr/opd/msgzz.jsp?loginid=13919", ENDITEM,
"URL=../images/0overbut.gif", "Referer=http://192.168.88.29:8080/emr/emr/opd/ysz_left.jsp?id=13919&DR_CODE=100105&LOGIN_DIV=1125&PRO_FLG=&if_check=Y&OPD_AREA=1", ENDITEM,
"URL=../images/0thisbut.gif", "Referer=http://192.168.88.29:8080/emr/emr/opd/ysz_left.jsp?id=13919&DR_CODE=100105&LOGIN_DIV=1125&PRO_FLG=&if_check=Y&OPD_AREA=1", ENDITEM,
"URL=/emr/HtmSourse/ucren-widgets/common/skins/lv2/win-btn.gif", "Referer=http://192.168.88.29:8080/emr/emr/opd/msgzz.jsp?loginid=13919", ENDITEM,
"URL=/emr/sysimage/2border_02.gif", "Referer=http://192.168.88.29:8080/emr/emr/opd/pat_lisy.jsp", ENDITEM,
"URL=/emr/HtmSourse/ucren-widgets/common/skins/qq/interface.css", "Referer=http://192.168.88.29:8080/emr/emr/opd/reg_opd.jsp", ENDITEM,
"URL=/emr/HtmSourse/ucren-widgets/common/skins/qq/win-point.gif", "Referer=http://192.168.88.29:8080/emr/emr/opd/reg_opd.jsp", ENDITEM,
"URL=/emr/HtmSourse/ucren-widgets/common/skins/qq/win-resbar.gif", "Referer=http://192.168.88.29:8080/emr/emr/opd/reg_opd.jsp", ENDITEM,
"URL=/emr/HtmSourse/ucren-widgets/common/skins/qq/win-lr.gif", "Referer=http://192.168.88.29:8080/emr/emr/opd/reg_opd.jsp", ENDITEM,
"URL=/emr/HtmSourse/ucren-widgets/common/skins/qq/win-tb.gif", "Referer=http://192.168.88.29:8080/emr/emr/opd/reg_opd.jsp", ENDITEM,
"URL=/emr/HtmSourse/ucren-widgets/common/skins/qq/win-bd.gif", "Referer=http://192.168.88.29:8080/emr/emr/opd/reg_opd.jsp", ENDITEM,
"URL=/emr/HtmSourse/ucren-widgets/common/skins/qq/win-tit.gif", "Referer=http://192.168.88.29:8080/emr/emr/opd/reg_opd.jsp", ENDITEM,
"URL=/emr/HtmSourse/ucren-widgets/common/skins/qq/win-btn.gif", "Referer=http://192.168.88.29:8080/emr/emr/opd/reg_opd.jsp", ENDITEM,
LAST);
web_custom_request("ajaxdo.do_4",
"URL=http://192.168.88.29:8080/emr/ajaxdo.do?dotype=4&div_cde=100105®_TICKET_ID=13919&selreq=&if_check=Y",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.88.29:8080/emr/emr/opd/msgzz.jsp?loginid=13919",
"Snapshot=t18.inf",
"Mode=HTML",
"EncType=",
LAST);
lr_log_message("用户名:%s", lr_eval_string("{username}"));
lr_log_message("%s", lr_eval_string("{num}"));
if(strcmp(lr_eval_string("{num}"),"0")==0)
lr_log_message("登陆失败!");
else
lr_log_message("登陆成功!");
return 0;
}
vuser_end()
vuser_end(){
web_url("close.jsp",
"URL=http://192.168.88.29:8080/emr/close.jsp?menu_sys=ADMIN",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t19.inf",
"Mode=HTML",
LAST);
return 0;
}
```````````````
有没有人帮助一下啊```````
```人都去哪了啊
页:
[1]