|
本人想使用ld自带的订票例子来学习ld,创建了一个包含订票例子中要填入的注册信息(Username,Password ,Confirm, ,First Name,Last Name,Street Address,City/State/Zip)对应的dat文件(数据共10行),然后在controller中指定了10个vuser,在controller未进行其他配置,然后进行压力测试,但是运行结束后,发现不能将10个注册信息进行注册,即不能采用dat文件中的信息进行注册.
1 vuser脚本中的action部门如下,vuser_init和vuser_end和它们默认的一样:
#include "web_api.h"
Action()
{
web_url("MercuryWebTours",
"URL=http://localhost/MercuryWebTours/",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
lr_think_time(3);
web_submit_data("login.pl",
"Action=http://localhost/MercuryWebTours/login.pl",
"Method=POST",
"TargetFrame=body",
"RecContentType=text/html",
"Referer=http://localhost/MercuryWebTours/nav.pl?in=home",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value=94772.2729040097tiHtitipHiHfcQctQpAQcHcf", ENDITEM,
"Name=username", "Value=", ENDITEM,
"Name=password", "Value=", ENDITEM,
"Name=JSFormSubmit", "Value=off", ENDITEM,
"Name=signup.x", "Value=46", ENDITEM,
"Name=signup.y", "Value=9", ENDITEM,
LAST);
lr_think_time(25);
web_submit_data("login.pl_2",
"Action=http://localhost/MercuryWebTours/login.pl",
"Method=POST",
"TargetFrame=body",
"RecContentType=text/html",
"Referer=http://localhost/MercuryWebTours/login.pl?username=&password=&getInfo=true",
"Snapshot=t3.inf",
"Mode=HTML",
ITEMDATA,
"Name=username", "Value={name}", ENDITEM,
"Name=password", "Value={pass}", ENDITEM,
"Name=passwordConfirm", "Value={passwordcon}", ENDITEM,
"Name=firstName", "Value={firt}", ENDITEM,
"Name=lastName", "Value={last}", ENDITEM,
"Name=address1", "Value={address1}", ENDITEM,
"Name=address2", "Value={address2}", ENDITEM,
"Name=register.x", "Value=46", ENDITEM,
"Name=register.y", "Value=23", ENDITEM,
LAST);
web_url("continue.gif",
"URL=http://localhost/MercuryWebTours/welcome.pl?page=menus",
"TargetFrame=body",
"Resource=0",
"RecContentType=text/html",
"Referer=http://localhost/MercuryWebTours/login.pl",
"Snapshot=t4.inf",
"Mode=HTML",
LAST);
web_url("SignOff Button",
"URL=http://localhost/MercuryWebTours/welcome.pl?signOff=1",
"TargetFrame=body",
"Resource=0",
"RecContentType=text/html",
"Referer=http://localhost/MercuryWebTours/nav.pl?page=menu&in=home",
"Snapshot=t5.inf",
"Mode=HTML",
LAST);
return 0;
}
2 vuser中脚本中参数设置的参见附件 |
|