|
2#
楼主 |
发表于 2012-5-15 14:47:22
|
只看该作者
Action()
{
web_custom_request("login.htm",
"URL=http://192.168.205.150/svc-console/login.htm?method=queryMachantEmpList",
"Method=POST",
"TargetFrame=",
"Resource=0",
"RecContentType=application/json",
"Referer=http://192.168.205.150/svc-console/index.htm",
"Snapshot=t5.inf",
"Mode=HTML",
"EncType=application/json",
"Body={\"loginName\":\"13500000000\"}",
LAST);
web_reg_find("Text=退出",
LAST);
/*添加集合点,实现用户并发登录*/
lr_rendezvous("登录");
/*添加检查点,检查用户是否登录成功*/
lr_start_transaction("登录");
web_submit_data("login.htm_2",
"Action=http://192.168.205.150/svc-console/login.htm?method=login",
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://192.168.205.150/svc-console/index.htm",
"Snapshot=t6.inf",
"Mode=HTML",
ITEMDATA,
"Name=loginName", "Value={username}", ENDITEM,
"Name=empSel", "Value=admin", ENDITEM,
"Name=empSel_CRtext", "Value=admin", ENDITEM,
"Name=password", "Value=a123456", ENDITEM,
"Name=按钮.x", "Value=46", ENDITEM,
"Name=按钮.y", "Value=16", ENDITEM,
EXTRARES,
"URL=../svc-static/images/line.jpg", "Referer=http://192.168.205.150/svc-console/svc/main.htm?employeeId=166&machantId=114&menuId=0000&loginName={username}", ENDITEM,
"URL=../svc-static/images/ydzytitlebj.jpg", "Referer=http://192.168.205.150/svc-console/svc/main.htm?employeeId=166&machantId=114&menuId=0000&loginName={username}", ENDITEM,
"URL=../svc-static/images/ydzybj.jpg", "Referer=http://192.168.205.150/svc-console/svc/main.htm?employeeId=166&machantId=114&menuId=0000&loginName={username}", ENDITEM,
"URL=../svc-static/images/menubj2.jpg", "Referer=http://192.168.205.150/svc-console/svc/main.htm?employeeId=166&machantId=114&menuId=0000&loginName={username}", ENDITEM,
LAST);
lr_end_transaction("登录", LR_AUTO);
return 0;
}
这个是脚本,设置了250个vuser,并发率设置了30% |
|