|
4#
楼主 |
发表于 2008-10-30 13:11:57
|
只看该作者
代码附上
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;
} |
|