hi..i want to validate the login TXn...On successful it should send
user message to the replay log..On failure it should throw an error
message and abort the Vuser.....when i run the script below it will
always send the lr_output_message(**) even on failing the Vuser log
in.....can anyone help out please?
_____________________________________________________________________________________
Action()
{
int status;
web_reg_find("Text=Web Tours",LAST);
web_reg_save_param("user_id",
"LB=userSession value=",
"RB=>",
"Search=Body",
LAST);
status = web_url("webtours",
"URL=
http://127.0.0.1:1080/webtours",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
//*****************************************************
if (status==LR_PASS) {
lr_output_message ("**LOGIN SUCESSFUL");
}
else {
lr_error_message ("**Error:FAILED TO LAUNCH WEBTOURS...");
lr_abort ();
}
//*****************************************************
lr_think_time(12);
web_reg_find("Text=Web Tours",LAST);
web_submit_data("
login.pl",
"Action=
http://127.0.0.1:1080/webtours/login.pl",
"Method=POST",
"TargetFrame=body",
"RecContentType=text/html",
"Referer=
http://127.0.0.1:1080/webtours/nav.pl?in=home",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value={user_id}", ENDITEM,
"Name=username", "Value=spkar", ENDITEM,
"Name=password", "Value=sridevi", ENDITEM,
"Name=JSFormSubmit", "Value=off", ENDITEM,
"Name=login.x", "Value=0", ENDITEM,
"Name=login.y", "Value=0", ENDITEM,
LAST);
____________________________________________________________________________________
THIS IS WHAT IT SHOW IN THE REPLAY LOG ..EVEN THE LOGIN IS FAILED
Starting iteration 1.
Starting action Action.
Action.c(13): web_url("webtours") was successful, 6453 body bytes,
1724 header bytes [MsgId: MMSG-26386]
Action.c(25): **LOGIN SUCESSFUL
Action.c(35): Registering web_reg_find was successful [MsgId:
MMSG-26390]