修改密码后事务状态还是"login_test" ended with "Pass" status
来源:4-17 自动事务与手动事务
T_M_T
2022-03-18
脚本
Action()
{
web_reg_save_param("usersession",
"LB=userSession value=",
"RB=>",
LAST);
web_url("WebTours",
"URL=http://127.0.0.1:2080/WebTours/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
web_reg_find("Text=muke",
"SaveCount=muke_count",
LAST );
lr_start_transaction("login_test");
web_submit_data("login.pl",
"Action=http://127.0.0.1:2080/WebTours/login.pl",
"Method=POST",
"RecContentType=text/html",
"Referer=http://127.0.0.1:2080/WebTours/nav.pl?in=home",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value={usersession}", ENDITEM,
"Name=username", "Value=muke", ENDITEM,
"Name=password", "Value=123456", ENDITEM,
"Name=JSFormSubmit", "Value=on", ENDITEM,
"Name=login.x", "Value=62", ENDITEM,
"Name=login.y", "Value=23", ENDITEM,
LAST);
//增加判断,如果检查用户名muke出现次数大于0,则认为登录成功,否则失败
if (atoi (lr_eval_string("{muke_count}")) > 0 )
lr_end_transaction("login_test", LR_PASS);
else
lr_end_transaction("login_test", LR_FAIL);
web_image("SignOff Button",
"Alt=SignOff Button",
"Snapshot=t3.inf",
LAST);
return 0;
}
控制台
Virtual User Script started at : 2022-03-17 23:58:25
Starting action vuser_init.
Web Turbo Replay of LoadRunner 11.0.0 for Windows 7; build 9409 (Jan 11 2012 11:34:16) [MsgId: MMSG-27143]
Run Mode: HTML [MsgId: MMSG-26000]
Run-Time Settings file: "D:\WebTours\\default.cfg" [MsgId: MMSG-27141]
Ending action vuser_init.
Running Vuser...
Starting iteration 1.
Starting action Action.
Action.c(3): Registering web_reg_save_param was successful [MsgId: MMSG-26390]
Action.c(8): Detected non-resource "http://127.0.0.1:2080/WebTours/header.html" in "http://127.0.0.1:2080/WebTours/" [MsgId: MMSG-26574]
Action.c(8): Detected non-resource "http://127.0.0.1:2080/WebTours/welcome.pl?signOff=true" in "http://127.0.0.1:2080/WebTours/" [MsgId: MMSG-26574]
Action.c(8): Found resource "http://127.0.0.1:2080/WebTours/images/hp_logo.png" in HTML "http://127.0.0.1:2080/WebTours/header.html" [MsgId: MMSG-26659]
Action.c(8): Found resource "http://127.0.0.1:2080/WebTours/images/webtours.png" in HTML "http://127.0.0.1:2080/WebTours/header.html" [MsgId: MMSG-26659]
Action.c(8): Detected non-resource "http://127.0.0.1:2080/WebTours/nav.pl?in=home" in "http://127.0.0.1:2080/WebTours/welcome.pl?signOff=true" [MsgId: MMSG-26574]
Action.c(8): Detected non-resource "http://127.0.0.1:2080/WebTours/home.html" in "http://127.0.0.1:2080/WebTours/welcome.pl?signOff=true" [MsgId: MMSG-26574]
Action.c(8): Found resource "http://127.0.0.1:2080/WebTours/JSFormSubmit.js" in HTML "http://127.0.0.1:2080/WebTours/nav.pl?in=home" [MsgId: MMSG-26659]
Action.c(8): Found resource "http://127.0.0.1:2080/WebTours/images/mer_login.gif" in HTML "http://127.0.0.1:2080/WebTours/nav.pl?in=home" [MsgId: MMSG-26659]
Action.c(8): web_url("WebTours") was successful, 346237 body bytes, 1816 header bytes [MsgId: MMSG-26386]
Action.c(17): Registering web_reg_find was successful [MsgId: MMSG-26390]
Action.c(22): Notify: Transaction "login_test" started.
Action.c(24): Detected non-resource "http://127.0.0.1:2080/WebTours/nav.pl?page=menu&in=home" in "http://127.0.0.1:2080/WebTours/login.pl" [MsgId: MMSG-26574]
Action.c(24): Detected non-resource "http://127.0.0.1:2080/WebTours/login.pl?intro=true" in "http://127.0.0.1:2080/WebTours/login.pl" [MsgId: MMSG-26574]
Action.c(24): Found resource "http://127.0.0.1:2080/WebTours/images/flights.gif" in HTML "http://127.0.0.1:2080/WebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659]
Action.c(24): Found resource "http://127.0.0.1:2080/WebTours/images/itinerary.gif" in HTML "http://127.0.0.1:2080/WebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659]
Action.c(24): Found resource "http://127.0.0.1:2080/WebTours/images/in_home.gif" in HTML "http://127.0.0.1:2080/WebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659]
Action.c(24): Found resource "http://127.0.0.1:2080/WebTours/images/signoff.gif" in HTML "http://127.0.0.1:2080/WebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659]
Action.c(24): Registered web_reg_find successful for "Text=muke" (count=1) [MsgId: MMSG-26364]
Action.c(24): web_submit_data("login.pl") was successful, 5693 body bytes, 1501 header bytes [MsgId: MMSG-26386]
**Action.c(42): Notify: Transaction "login_test" ended with "Pass" status (Duration: 0.4880 Wasted Time: 0.0038).**
Action.c(47): Image-linking to "http://127.0.0.1:2080/WebTours/welcome.pl?signOff=1", Target Frame="body" [MsgId: MMSG-27993]
Action.c(47): Detected non-resource "http://127.0.0.1:2080/WebTours/nav.pl?in=home" in "http://127.0.0.1:2080/WebTours/welcome.pl?signOff=1" [MsgId: MMSG-26574]
Action.c(47): Detected non-resource "http://127.0.0.1:2080/WebTours/home.html" in "http://127.0.0.1:2080/WebTours/welcome.pl?signOff=1" [MsgId: MMSG-26574]
Action.c(47): Retrieving data from cache for "http://127.0.0.1:2080/WebTours/home.html" [MsgId: MMSG-26558]
Action.c(47): Resource "http://127.0.0.1:2080/WebTours/JSFormSubmit.js" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(47): Resource "http://127.0.0.1:2080/WebTours/images/mer_login.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]
Action.c(47): web_image("SignOff Button") was successful, 2162 body bytes, 644 header bytes [MsgId: MMSG-26386]
Ending action Action.
Ending iteration 1.
Ending Vuser...
Starting action vuser_end.
Ending action vuser_end.
Vuser Terminated.
写回答
1回答
-
T_M_T
提问者
2022-03-18
需改注册查找可以实现事务失败
00
相似问题