|
脚本如下:
Action()
{
//关联session
web_reg_save_param("usersession",
"LB=userSession value=", "RB=>",
LAST );
web_url("WebTours",
"URL=http://127.0.0.1:1080/WebTours/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t6.inf",
"Mode=HTML",
EXTRARES,
LAST);
lr_think_time(9);
web_reg_find("Text=Welcome",
"SaveCount=Welcome_Count",
LAST );
lr_start_transaction("login");
web_submit_form("login.pl",
"Snapshot=t7.inf",
ITEMDATA,
//调用session
"Name=userSession", "Value={usersession}", ENDITEM,
"Name=username", "Value={username}", ENDITEM,
"Name=password", "Value={psw}", ENDITEM,
"Name=login.x", "Value=53", ENDITEM,
"Name=login.y", "Value=12", ENDITEM,
LAST);
//判断count>0 则显示登陆成功 反之失败。
if(atoi(lr_eval_string("{Welcome_Count}")) > 0)
lr_output_message("登陆成功");
else
lr_error_message("登陆失败");
lr_end_transaction("login", LR_AUTO);
web_image_check("logoff", "Src=/WebTours/images/signoff.gif", LAST );
web_image("SignOff Button",
"Alt=SignOff Button",
"Snapshot=t8.inf",
LAST);
return 0;
}
日志如下
Starting iteration 1.
Starting action Action.
Action.c(5): Registering web_reg_save_param was successful [MsgId: MMSG-26390]
Action.c(9): Detected non-resource "http://127.0.0.1:1080/WebTours/header.html" in "http://127.0.0.1:1080/WebTours/" [MsgId: MMSG-26574]
Action.c(9): Detected non-resource "http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true" in "http://127.0.0.1:1080/WebTours/" [MsgId: MMSG-26574]
Action.c(9): Found resource "http://127.0.0.1:1080/WebTours/images/hp_logo.png" in HTML "http://127.0.0.1:1080/WebTours/header.html" [MsgId: MMSG-26659]
Action.c(9): Found resource "http://127.0.0.1:1080/WebTours/images/webtours.png" in HTML "http://127.0.0.1:1080/WebTours/header.html" [MsgId: MMSG-26659]
Action.c(9): Detected non-resource "http://127.0.0.1:1080/WebTours/nav.pl?in=home" in "http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true" [MsgId: MMSG-26574]
Action.c(9): Detected non-resource "http://127.0.0.1:1080/WebTours/home.html" in "http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true" [MsgId: MMSG-26574]
Action.c(9): Found resource "http://127.0.0.1:1080/WebTours/JSFormSubmit.js" in HTML "http://127.0.0.1:1080/WebTours/nav.pl?in=home" [MsgId: MMSG-26659]
Action.c(9): Found resource "http://127.0.0.1:1080/WebTours/images/mer_login.gif" in HTML "http://127.0.0.1:1080/WebTours/nav.pl?in=home" [MsgId: MMSG-26659]
Action.c(9): web_url("WebTours") was successful, 6875 body bytes, 1808 header bytes [MsgId: MMSG-26386]
Action.c(22): Registering web_reg_find was successful [MsgId: MMSG-26390]
Action.c(29): Notify: Transaction "login" started.
Action.c(30): Submitting form to "http://127.0.0.1:1080/WebTours/error.pl", Target Frame="body" [MsgId: MMSG-27978]
Action.c(30): Found resource "http://127.0.0.1:1080/WebTours/images/splash_error2.jpg" in HTML "http://127.0.0.1:1080/WebTours/error.pl" [MsgId: MMSG-26659]
Action.c(30): Found resource "http://127.0.0.1:1080/WebTours/images/startover.gif" in HTML "http://127.0.0.1:1080/WebTours/error.pl" [MsgId: MMSG-26659]
Action.c(30): Warning -26627: HTTP Status-Code=404 (Not found) for "http://127.0.0.1:1080/WebTours/images/startover.gif" [MsgId: MWAR-26627]
Action.c(30): Warning -26627: HTTP Status-Code=404 (Not found) for "http://127.0.0.1:1080/WebTours/images/splash_error2.jpg" [MsgId: MWAR-26627]
Action.c(30): Registered web_reg_find successful for "Text=Welcome" [MsgId: MMSG-26362]
Action.c(30): web_submit_form("login.pl") highest severity level was "warning", 1174 body bytes, 514 header bytes [MsgId: MMSG-26388]
Action.c(43): Error: 登陆失败
Action.c(44): Notify: Transaction "login" ended with "Pass" status (Duration: 11.5453 Wasted Time: 0.0020).
Action.c(48): Error -27191: "logoff" failed (0 occurrence(s) found. Alt="", Src="/WebTours/images/signoff.gif") [MsgId: MERR-27191]
Action.c(48): web_image_check highest severity level was "ERROR" [MsgId: MMSG-26391]
Ending action Action.
Ending iteration 1. |
|