Skip to main content

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.

Extended Log in Run-time Settings
Extended Log in Run-time Settings
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 required.


#ifndef _GLOBALS_H
#define _GLOBALS_H
//--------------------------------------------------------------------
//Include Files
 #include "lrun.h"
#include "web_api.h"
#include "lrw_custom_body.h"
//Global Variables
Extended_Log_On()
{
lr_set_debug_message (LR_MSG_CLASS_EXTENDED_LOG | LR_MSG_CLASS_FULL_TRACELR_SWITCH_ON);
return 0;
}
Extended_Log_Off()
{
lr_set_debug_message (LR_MSG_CLASS_EXTENDED_LOG | LR_MSG_CLASS_FULL_TRACELR_SWITCH_OFF);
return 0;
}
#endif // _GLOBALS_H

Action Part Started Here:

Action()
{
    Extended_Log_On();
       web_url("Bing",
        "URL=http://news.google.com/",
        "Mode=HTML",
        LAST );
     Extended_Log_On();
     return 0;
}

There are mainly three setting for message logging. The second table is used to further refine the message logging.

Log LevelC LanguageConstantsValue
DisabledLR_MSG_CLASS_DISABLE_LOG0
BriefLR_MSG_CLASS_BRIEF_LOG1
Extended Log LR_MSG_CLASS_EXTENDED_LOG16

Log LevelC Language ConstantsValue
Result DataLR_MSG_CLASS_RESULT_DATA2
Parameter SubstitutionLR_MSG_CLASS_PARAMETERS4
Full Run-Time Trace LR_MSG_CLASS_FULL_TRACE 8

Comments

Post a Comment

Popular posts from this blog

NeoLoad Interview Questions and Answers

Here are some of the interview questions and answers on NeoLoad:
What is NeoLoad?
NeoLoad is a performance testing tool designed to test different types of web, standalone and mobile applications.
What is the difference between Loadrunner, JMeter and NeoLoad?
Click here for differences
What are the different counters you monitor in NeoLoad?
Average Response Time(requests), average response time(pages), average requests/s, average throughput, current response time(requests), current response time(pages), current requests, current throughput, current users count, controller cpu load, controller memory load etc.
What are the different type of tools you can integrate with NeoLoad?
App Dynamics, CA APM Integration, Dyna trace integration, HP ALM or Quality Center Integration, Java and Jamo Solutions M-eux Test Integration, Jenkins Integration, perfecto mobile integration, selenium integration.
What are the different type of Operating systems you can monitor?
Linux Monitor, Solaris Monitor, AIX …

File operations in loadrunner with examples

In this post I will explain how to capture a value from server response and save to a text file using vugen.
How to capture and save to text file using loadrunner:
First I have recorded the script using bing.com and then i searched for IBM. We will get 10 results. I have captured all the 10 values and saved to a file.
Here is the code for that.

Sitescope Monitoring Tool Features and Monitors

Why Sitescope is called Agentless Monitoring Tool?
HP SiteScope monitors the application/infrastructure/server/operating system without installing any agent software on the system to be monitored. This feature makes the installation, usage and maintenance of Sitescope simpler when compared with the any performance monitoring tools like Diagnostics.
Sitescope Monitors:
Sitescope has also upgraded and changed drastically to meet the rapidly changing technologies and environments like virtualization and cloud computing. Using Sitescope we can monitor different web servers, application servers and database servers. We can also monitor operating systems Windows, Linux, Sun Solaris, IBM AIX. It has more than 100 monitors including Weblogic, Websphere, SAP, SIEBEL, SNMP, LDAP, Network Monitor etc. HP SiteScope can also monitor cpu utilization, response time, disk space, and resource availability of a variety of host types and application platforms.
Sitescope Features:
SiteScope provides failover …