TA的每日心情 | 开心 2018-1-25 11:31 |
---|
签到天数: 2 天 连续签到: 2 天 [LV.1]测试小兵
|
经过检查,发现问题所在。conut找不到的原因在于未对登录用户的动态值进行关联!
刚玩LR,自己录了下自带的网站登录脚本,在加入检查点后,为什么我这里的count数量不会加上去,查看日志一直显示0!预期结果应该是第一个登录成功,第二个用户登录失败!
还请各位帮我看看~小弟在此多谢了!
这个是我录制的脚本:
Action()
{
lr_start_transaction("用户登录");
lr_rendezvous("点击登录");
web_reg_find("Text=jojo",
"SaveCount=count",
"Search=Body",
LAST);
web_submit_data("login.pl",
"Action=http://localhost:1080/WebTours/login.pl",
"Method=POST",
"RecContentType=text/html",
"Referer=http://localhost:1080/WebTours/nav.pl?in=home",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=username", "Value={username}", ENDITEM,
"Name=password", "Value=bean", ENDITEM,
"Name=JSFormSubmit", "Value=off", ENDITEM,
"Name=login.x", "Value=33", ENDITEM,
"Name=login.y", "Value=10", ENDITEM,
LAST);
lr_end_transaction("用户登录", LR_AUTO);
lr_log_message("用户名:%s", lr_eval_string("{username}"));
if (atoi(lr_eval_string("{count}"),0) == 0)
lr_log_message("登录失败");
else
lr_log_message("登录成功");
return 0;
}
这个是回放日志:
Running Vuser...
Starting iteration 1.
Warning -27077: The "vuser_init" section contains web function(s) when the "Simulate a new user on each iteration" Run-Time Setting is ON. This may produce unpredictable results with multiple iterations [MsgId: MWAR-27077]
Starting action Action.
Action.c(4): Notify: Transaction "用户登录" started.
Action.c(6): Rendezvous 点击登录
Action.c(8): Registering web_reg_find was successful [MsgId: MMSG-26390]
Action.c(12): Notify: Parameter Substitution: parameter "username" = "jojo"
Action.c(12): Registered web_reg_find successful for "Text=jojo" [MsgId: MMSG-26362]
Action.c(12): Notify: Saving Parameter "count = 0"
Action.c(12): web_submit_data("login.pl") was successful, 741 body bytes, 225 header bytes [MsgId: MMSG-26386]
Action.c(27): Notify: Transaction "用户登录" ended with "ass" status (Duration: 0.9780 Wasted Time: 0.0000).
Action.c(29): Notify: Parameter Substitution: parameter "username" = "jojo"
用户名:jojo
Action.c(31): Notify: Parameter Substitution: parameter "count" = "0"
登录失败
Ending action Action.
Ending iteration 1.
Starting iteration 2.
Notify: Next row for parameter username = 2 [table = username].
Notify: Getting new value for parameter 'username': table = 'username.dat' column = '0' row = '2'.
Starting action Action.
Action.c(4): Notify: Transaction "用户登录" started.
Action.c(6): Rendezvous 点击登录
Action.c(8): Registering web_reg_find was successful [MsgId: MMSG-26390]
Action.c(12): Notify: Parameter Substitution: parameter "username" = "222222"
Action.c(12): Registered web_reg_find successful for "Text=jojo" [MsgId: MMSG-26362]
Action.c(12): Notify: Saving Parameter "count = 0"
Action.c(12): web_submit_data("login.pl") was successful, 741 body bytes, 225 header bytes [MsgId: MMSG-26386]
Action.c(27): Notify: Transaction "用户登录" ended with "ass" status (Duration: 0.9621 Wasted Time: 0.0000).
Action.c(29): Notify: Parameter Substitution: parameter "username" = "222222"
用户名:222222
Action.c(31): Notify: Parameter Substitution: parameter "count" = "0"
登录失败
Ending action Action.
Ending iteration 2.
Ending Vuser...
[ 本帖最后由 Tesherlock 于 2009-2-22 15:22 编辑 ] |
|