controller使用50人进行登陆测试,日志中为什么看不到输出的用户名和密码
本人是个新手,想要执行50个不同的用户同时进行登陆测试,参数选择为unique和each interation,迭代次数选择1,参数列表中已经输入了50个用户名和密码,代码如下:我现在有几个问题不太明白:
1)想要测试50个用户并发登陆,按照下面的代码是否可以实现呢?
2)如果能够实现,为什么在日志中用户名和密码不显示呢?这些在日志中能够看到吗?
3)如果不可以实现,我需要怎么修改呢?
lr_think_time(15);
web_url("Dv_GetCode.asp",
"URL=http://localhost/rencailuntan/Dv_GetCode.asp?t=0.8430000212330779",
"Resource=1",
"RecContentType=image/bmp",
"Referer=http://localhost/rencailuntan/index.asp",
"Snapshot=t3.inf",
LAST);
web_url("ajax_check.asp",
"URL=http://localhost/rencailuntan/ajax_check.asp?rs=checke_dvcode&rsargs[]=checke_dvcode&rsargs[]=codestr&rsargs[]=0731&rsrnd=1241428205171",
"Resource=0",
"RecContentType=text/html",
"Referer=http://localhost/rencailuntan/index.asp",
"Snapshot=t4.inf",
"Mode=HTML",
EXTRARES,
"URL=images/button_bg2.gif", "Referer=http://localhost/rencailuntan/index.asp", ENDITEM,
LAST);
lr_think_time(17);
web_url("button_bg2.gif",
"URL=http://localhost/rencailuntan/images/button_bg2.gif",
"Resource=1",
"RecContentType=image/gif",
"Referer=http://localhost/rencailuntan/index.asp",
"Snapshot=t5.inf",
LAST);
lr_start_transaction("userstartdenglu");
trans_time=lr_get_transaction_duration( "userstartdenglu" );
//lr_get_transaction_duration这个函数可以得到事务执行所消耗的时间
web_reg_find("Text=已经登陆","SaveCount=num","Search=body",LAST);
lr_rendezvous("denglurenshu");//插入集合点
web_submit_data("login.asp",
"Action=http://localhost/rencailuntan/login.asp?action=chk",
"Method=POST",
"RecContentType=text/html",
"Referer=http://localhost/rencailuntan/index.asp",
"Snapshot=t6.inf",
"Mode=HTML",
ITEMDATA,
"Name=username", "Value={username}", ENDITEM,
"Name=password", "Value={password}", ENDITEM,
"Name=submit", "Value= 登 录 ", ENDITEM,
LAST);
web_custom_request("activeonline.asp_2",
"URL=http://localhost/rencailuntan/activeonline.asp",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer=http://localhost/rencailuntan/index.asp",
"Snapshot=t7.inf",
"Mode=HTML",
"Body=state=%u6B22%u8FCE%u8BBF%u95EE%5B%u5C31%u4E1A%u670D%u52A1%5D&boardid=0",
LAST);
lr_end_transaction("userstartdenglu", LR_AUTO);
lr_log_message("使用参数值: %s", lr_eval_string("{username}"));
lr_log_message("使用密码: %s", lr_eval_string("{password}"));
if (strcmp(lr_eval_string("{num}"),"0")==0)
lr_log_message("登录失败!");
else
lr_log_message("登录成功!"); 在run-time setting中启用log,然后到对应的文件夹下就能找到log信息了 已经设置了,但是还是找不到,出现(userdenglu.c(59): 错误: Failed to end Transaction "userstartdenglu" (by name). Please check that you made a call to start transaction operation.)提示 参数设置为这种方式试试看
sequential
each iteration :) ,谢谢,将参数改成您说的sequential和each iteration后,部分用户名和密码在日志中出现,还有大部分没出现,这是说明测试的代码有问题吗? 你的参数设置 跟你的循环测试有关系引起的 参数设置用 unique:) :) ,谢谢,问题找到了,是没有进行退出而一直登陆引起的错误,所以日子没有显示
页:
[1]