|
Action()
{
web_add_cookie("cod=1.2.3; DOMAIN=10.81.64.102");
web_add_cookie("csd=4; DOMAIN=10.81.64.102");
web_url("priv_useradmin.jsp",
"URL=http://10.81.64.102:7788/priv_useradmin.jsp",
"Resource=0",
"RecContentType=text/html",
"Referer=http://10.81.64.102:7788/tree.jsp",
"Mode=HTML",
EXTRARES,
"Url=images/jsw.jpg", ENDITEM,
LAST);
web_link("添加用户",
"Text=添加用户",
EXTRARES,
"Url=images/jsw.jpg", ENDITEM,
LAST);
lr_rendezvous("adduser");
lr_start_transaction("adduser");
web_submit_form("priv_saveinfo.jsp",
ITEMDATA,
"Name=txt_user_name", "Value=testname",ENDITEM,
"Name=txt_user_pwd", "Value=111111", ENDITEM,
"Name=txt_sure_pwd", "Value=111111", ENDITEM,
"Name=txt_realname", "Value=test", ENDITEM,
"Name=txt_sex", "Value=男", ENDITEM,
"Name=Submit", "Value=提交", ENDITEM,
EXTRARES,
"Url=images/jsw.jpg", "Referer=http://10.81.64.102:7788/priv_saveinfo.jsp?action=addUser", ENDITEM,
LAST);
lr_end_transaction("adduser",LR_AUTO);
web_image("exit.gif",
"Src=images/exit.gif",
"Ordinal=1",
EXTRARES,
"Url=images/jsw.jpg", "Referer=http://10.81.64.102:7788/priv_userroles.jsp?uId=11255", ENDITEM,
LAST);
lr_rendezvous("assignrole");
lr_start_transaction("assignrole");
web_submit_data("priv_saveinfo.jsp_2",
"Action=http://10.81.64.102:7788/priv_saveinfo.jsp?action=assignRoles&uName=testname",
"Method=POST",
"RecContentType=text/html",
"Referer=http://10.81.64.102:7788/priv_userroles.jsp?uId=11255",
"Mode=HTML",
ITEMDATA,
"Name=pageNum", "Value=1", ENDITEM,
"Name=userRoles", "Value=administrator", ENDITEM,
"Name=txt_page", "Value=1", ENDITEM,
EXTRARES,
"Url=images/jsw.jpg", "Referer=http://10.81.64.102:7788/priv_saveinfo.jsp?action=assignRoles&uName=testname", ENDITEM,
LAST);
lr_end_transaction("assign",LR_AUTO);
web_image("exit.gif_2",
"Src=images/exit.gif",
EXTRARES,
"Url=images/jsw.jpg", ENDITEM,
LAST);
这是我录制的一部分脚本,在这个脚本中实现的主要功能为填加一个用户,并为这个用户分配管理员或其他的权限。
但是遇到了以下的问题:
1、添加的用户名必须为唯一的,而且必须为以字母开头
2、在每添加一个用户以后,跳转的页面地址中的UID为添加用户在数据库中的ID
这个关联应该如何处理?
谢谢大家 |
|