Skip to main content

Posts

Showing posts with the label lr functions

lr_debug_message function in loadrunner with examples

We can use this function in two ways with run time settings in loadrunner and with lr_set_debug_message.
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…

lr_set_debug_message function in loadrunner with examples

Lr_set_debug_message – One of my favorite lr function in loadrunner. It is mainly useful when we are unable to find correlation value in a particular request.
We usually use Extended log -> Data Returned by Server in Run-time Settings to get all the response in replay log. Sometimes the vugen will crash or becomes slow as the vugen is writing all the response to replay log.
If it crashes or taking long time to execute the script then it’s better to use lr_set_debug_message instead of using Data Returned by Server.
In the following example we have added data returned by server only to particular request.
Example:

lr_set_debug_message(LR_MSG_CLASS_EXTENDED_LOG|LR_MSG_CLASS_FULL_TRACE,LR_SWITCH_ON);
web_url("Bing",
"URL=http://www.bing.com/",
"Mode=HTML",
LAST);
lr_set_debug_message(LR_MSG_CLASS_EXTENDED_LOG|LR_MSG_CLASS_FULL_TRACELR_SWITCH_OFF);


lr_set_debug_message can also be written in the following way:

Declare in globals the following way and call wherever …