|
请教oadrunner 困饶很久的问题,一直不能理解. 使用的是8.1.
测试用例:打开首页登陆,输入用户名和密码.退出登陆. 要求测试并发多少用户登陆时,登陆成功的响应时间不超过6秒.
在 vuser 中录制脚本 , action 中录制打开首页,在登陆事物前插入集合点,后面是登陆事物的脚本,未做退出操作.
参数化登陆用户名,密码都是1.参数选择TEXT,50多个数据.
这里参数更新方法和数据分配该选什么?
sequential random unique
each iteration occurrence once
该如何组合.我选的是: unique occurrence
脚本没有设置迭代.
场景设置:50个VUSER,选择:ramp up (run until completion)
选择,initalize all Vusers before Run
配置集合点:选择policy 选择:Release when 100% of running Vuser arrive at the rendezcous
请帮我看下,如果就上面这个用例,就是同时并发X个用户登陆系统,测试响应时间不超过6秒.该如何设置,对于参数化和Vuser 的场景设置感到一头雾水.
我的想法是:模拟X个不同用户,打开首页后,X个不同用户,同时登陆系统。查看登陆事物成功的响应时间是否超过6秒。这样该如何设置运行时和场景设置才能达到我的目的.
例如:参数化的时候如果选择的是sequential +occurrence 同时加载 X个vuser 和选 unique+occurrence 是否都可以满足我的需求.我参数里的数据有50个值,我测试时最大的虚拟用户也只加到过50.这两各的区别就是如果选后一种,我的参数值的个数,要足够多就行吧. 高手给点播一下.怎么样才能搞清楚数据分配和更新方式与场景加载设置的关系.现在我思维很乱.
录制脚本如下:
Action()
{
web_add_auto_header("Accept-Language",
"zh-cn");
//[WCSPARAMWCSParam_Diff163HGY9JxbVFJd2TVhX3zdMGDbMhnv4x1fBFCMCrPfxv31hkyDDstpc!1351262724] Parameter {WCSParam_Diff1} created by Correlation Studio
web_reg_save_param("WCSParam_Diff1",
"LB=jsessionid=",
"RB=\"",
"Ord=1",
"RelFrameId=1",
"Search=Body",
"IgnoreRedirections=Yes",
LAST);
web_url("acegilogin.jsp",
"URL=http://10.1.35.51:7001/acegilogin.jsp",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"URL=/styles/ie.css", ENDITEM,
"URL=/styles/shenzhen/scpr.gif", ENDITEM,
LAST);
lr_rendezvous("登陆");
lr_start_transaction("登陆");
web_submit_form("j_acegi_security_check;jsessionid={WCSParam_Diff1}",
"Snapshot=t2.inf",
ITEMDATA,
"Name=j_username", "Value={j_username}", ENDITEM,
"Name=j_password", "Value=1", ENDITEM,
"Name=submit", "Value=登录", ENDITEM,
EXTRARES,
"URL=/styles/shenzhen/simpleClock.swf", "Referer=http://10.1.35.51:7001/presentation/index.do", ENDITEM,
"URL=/styles/shenzhen/clock3.swf", "Referer=http://10.1.35.51:7001/presentation/index.do", ENDITEM,
"URL=/styles/presentation/tabR.gif", "Referer=http://10.1.35.51:7001/presentation/toolbar.do", ENDITEM,
"URL=/styles/presentation/tabL.gif", "Referer=http://10.1.35.51:7001/presentation/toolbar.do", ENDITEM,
"URL=/styles/front/toolbar.gif", "Referer=http://10.1.35.51:7001/presentation/toolbar.do", ENDITEM,
"URL=/styles/site/print.gif", "Referer=http://10.1.35.51:7001/presentation/task.do", ENDITEM,
"URL=/styles/site/normalize.gif", "Referer=http://10.1.35.51:7001/presentation/task.do", ENDITEM,
LAST);
web_custom_request("clock.jsp",
"URL=http://10.1.35.51:7001/commons/clock.jsp?tstmp=1240570837078",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer=http://10.1.35.51:7001/styles/shenzhen/simpleClock.swf",
"Snapshot=t3.inf",
"Mode=HTML",
"Body=onLoad=%5Btype%20Function%5D&action=post",
LAST);
web_url("anytools.jsp",
"URL=http://10.1.35.51:7001/scripts/anytools.jsp",
"Resource=0",
"RecContentType=text/html",
"Referer=http://10.1.35.51:7001/presentation/task.do",
"Snapshot=t4.inf",
"Mode=HTML",
LAST);
web_url("blank.jsp",
"URL=http://10.1.35.51:7001/blank.jsp",
"Resource=0",
"RecContentType=text/html",
"Referer=http://10.1.35.51:7001/presentation/index.do",
"Snapshot=t5.inf",
"Mode=HTML",
EXTRARES,
"URL=/styles/catalog/body.gif", "Referer=http://10.1.35.51:7001/presentation/catalog.do?method=list", ENDITEM,
"URL=/styles/catalog/groupBar.gif", "Referer=http://10.1.35.51:7001/presentation/catalog.do?method=list", ENDITEM,
"URL=/styles/catalog/folderClosed.gif", "Referer=http://10.1.35.51:7001/presentation/catalog.do?method=list", ENDITEM,
LAST);
web_url("blank.jsp_2",
"URL=http://10.1.35.51:7001/blank.jsp",
"Resource=0",
"RecContentType=text/html",
"Referer=http://10.1.35.51:7001/presentation/index.do",
"Mode=HTML",
LAST);
web_url("blank.jsp_3",
"URL=http://10.1.35.51:7001/blank.jsp",
"Resource=0",
"RecContentType=text/html",
"Referer=http://10.1.35.51:7001/presentation/index.do",
"Snapshot=t6.inf",
"Mode=HTML",
LAST);
lr_end_transaction("登陆", LR_AUTO);
return 0;
} |
|