|
我想检查登录后,登录界面是否显示登录的用户名称。
我在输入账号和密码这个步骤之前添加web_reg_find函数,回放成功;但是把这个函数放在输入帐号和密码这个步骤之后,回放就失败了。我怀疑这个函数找到的用户名是不是我输入的那个,而不是登录成功以后界面上显示的那个。
具体脚本如下:
Administrator 16:59:23
Error -27259: Pending web_reg_save_param/reg_find/create_html_param[_ex] request(s) detected and reset at the end of the vuser_init section
Administrator 17:13:41
Error -27259: Pending web_reg_save_param/reg_find/create_html_param[_ex] request(s) detected and reset at the end of the vuser_init section [MsgId: MERR-27259]
Administrator 17:14:00
web_reg_find
swallow 17:35:06
("Search=Body",
Administrator 17:42:40
web_reg_find
swallow 18:07:27
“Search=All’,
Administrator 18:25:01
/* -------------------------------------------------------------------------------
Script Title :
Script Description :
Recorder Version : 8859
------------------------------------------------------------------------------- */
vuser_init()
{
//检查打开登陆页面需要多长时间
lr_start_transaction("loadLoginPage");
//请求登陆界面的一些图片资源
web_url("login.jsp",
"URL=http://104.0.40.82:9080/JPolaris/login.jsp",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t4.inf",
"Mode=HTML",
EXTRARES,
"Url=images/index/login_bg.png", ENDITEM, //登陆页面背景图
"Url=images/index/login_header_bg.png", ENDITEM,
"Url=images/index/login_list.png", ENDITEM,
"Url=images/index/login_content_bg.png", ENDITEM,
"Url=images/index/login_sub.png", ENDITEM,
LAST);
//页面打开结束
lr_end_transaction("loadLoginPage", LR_AUTO);
lr_think_time(7);
//检查页面上是否出现登陆的用户名以检查是否登陆成功,加在这里成功了 web_reg_find("Text=pq-demo",
LAST); //
//检查输入帐号密码后需要多长时间进入系统
lr_start_transaction("login");
web_submit_data("loginAction!checkLogin.action",
"Action=http://104.0.40.82:9080/JPolaris/loginAction!checkLogin.action",
"Method=POST",
"RecContentType=text/html",
"Referer=http://104.0.40.82:9080/JPolaris/login.jsp",
"Snapshot=t5.inf",
"Mode=HTML",
ITEMDATA,
"Name=username", "Value={user}", ENDITEM,
"Name=password", "Value=123", ENDITEM,
EXTRARES,
"Url=scripts/ext-3.4.0/resources/images/default/qtip/tip-sprite.gif", ENDITEM,
"Url=scripts/ext-3.4.0/resources/images/default/qtip/tip-anchor-sprite.gif", ENDITEM,
"Url=images/index/tips_20.jpg", ENDITEM,
"Url=scripts/ext-3.4.0/resources/images/default/panel/white-top-bottom.gif", ENDITEM,
"Url=scripts/ext-3.4.0/resources/images/default/panel/tool-sprites.gif", ENDITEM,
"Url=scripts/ext-3.4.0/resources/images/default/tabs/tab-strip-bg.gif", ENDITEM,
"Url=scripts/ext-3.4.0/resources/images/default/s.gif", ENDITEM,
"Url=scripts/ext-3.4.0/resources/images/default/tree/folder.gif", ENDITEM,
"Url=scripts/ext-3.4.0/resources/images/default/tree/elbow-plus-nl.gif", ENDITEM,
"Url=scripts/ext-3.4.0/resources/images/default/tree/leaf.gif", ENDITEM,
"Url=scripts/ext-3.4.0/resources/images/default/tree/loading.gif", ENDITEM,
"Url=scripts/ext-3.4.0/resources/images/default/tree/folder-open.gif", ENDITEM,
"Url=scripts/ext-3.4.0/resources/images/default/tree/elbow-minus-nl.gif", ENDITEM,
LAST);
//检查页面上是否出现登陆的用户名以检查是否登陆成功,加在这里失败了
web_reg_find("Text=pq-demo",
"Search=All",
LAST);
web_submit_data("loginAction!getMenusById.action",
"Action=http://104.0.40.82:9080/JPolaris/loginAction!getMenusById.action?id=10000000000000000000000000000000",
"Method=POST",
"RecContentType=text/html",
"Referer=http://104.0.40.82:9080/JPolaris/loginAction!checkLogin.action",
"Snapshot=t7.inf",
"Mode=HTML",
ITEMDATA,
"Name=node", "Value=10000000000000000000000000000000", ENDITEM,
LAST);
web_custom_request("directprovider",
"URL=http://104.0.40.82:9080/JPolaris/djn/directprovider",
"Method=POST",
"Resource=0",
"RecContentType=application/json",
"Referer=http://104.0.40.82:9080/JPolaris/loginAction!checkLogin.action",
"Snapshot=t8.inf",
"Mode=HTML",
"EncType=application/json",
"Body={\"action\":\"CommonAction\",\"method\":\"getFromFile\",\"data\":[\"autoOpenMainPage\"],\"type\":\"rpc\",\"tid\":2}",
LAST);
//进入系统结束
lr_end_transaction("login", LR_AUTO);
return 0;
} |
|