We can use this function in two ways with run time settings in loadrunner and with lr_set_debug_message.
Now I have recorded Facebook.com and used lr_debug_message.
If the extended log is enabled it will print the message "I Love Facebook" else it will ignore the message. It will not print any message if the extended log is not enabled.
lr_debug_message(LR_MSG_CLASS_EXTENDED_LOG, "I Love Facebook");
web_url("www.facebook.com",
"URL=http://www.facebook.com/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
Example 1:
Set extended log in run time settings(F4)->Log->Extended Log->Data Returned by Server.Now I have recorded Facebook.com and used lr_debug_message.
If the extended log is enabled it will print the message "I Love Facebook" else it will ignore the message. It will not print any message if the extended log is not enabled.
lr_debug_message(LR_MSG_CLASS_EXTENDED_LOG, "I Love Facebook");
web_url("www.facebook.com",
"URL=http://www.facebook.com/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
Example 2: With lr_set_debug_message
In this example I have used lr_set_debug_message with lr_debug_message as shown in the following example. It will print the message "I Love Facebook" if lr_set_debug_message is written else it will ignore. Try commenting lr_set_debug_message function the lr_debug_message will not print any data.
lr_set_debug_message(LR_MSG_CLASS_EXTENDED_LOG, LR_SWITCH_ON );
lr_debug_message(LR_MSG_CLASS_EXTENDED_LOG, "I Love Facebook");
web_url("www.facebook.com",
"URL=http://www.facebook.com/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
lr_set_debug_message(LR_MSG_CLASS_EXTENDED_LOG, LR_SWITCH_ON );
lr_debug_message(LR_MSG_CLASS_EXTENDED_LOG, "I Love Facebook");
web_url("www.facebook.com",
"URL=http://www.facebook.com/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
lr_set_debug_message(LR_MSG_CLASS_EXTENDED_LOG, LR_SWITCH_ON );
Output:
Starting action Action.
I Love Facebook
Action.c(6): web_url("www.facebook.com") started
.
.
.
.
Ending action Action.
Comments
Post a Comment