Sunday, 23 March 2014

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);

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 LogLR_MSG_CLASS_EXTENDED_LOG16

Log LevelC Language ConstantsValue
Result DataLR_MSG_CLASS_RESULT_DATA2
Parameter SubstitutionLR_MSG_CLASS_PARAMETERS4
Full Run-Time TraceLR_MSG_CLASS_FULL_TRACE8

No comments:

Post a Comment