Message Functions Present in Loadrunner

Message Functions

Below are the most important list of message functions present in loadrunner.

lr_debug_message :

  • lr_debug_message function sends a debug message when the specified message level is active.
  • If the specified message level is not active, a message is not issued.
  • So you can set the active message level to MSG_CLASS_BRIEF_LOG or MSG_CLASS_EXTENDED_LOG from the user interface or by using lr_set_debug_message.
  • But to determine the current level, use lr_get_debug_message.
  • Example : lr_debug_message(LR_MSG_CLASS_RESULT_DATA | LR_MSG_CLASS_PARAMETERS, "Operation failed.");

lr_error_message :

  • lr_error_message function sends an error message to product output windows log files, and other test report summaries.
  • Example : lr_error_message("Error: %s", "Unable to login to secure computing");

lr_get_debug_message :

  • lr_get_debug_message function returns the current log run-time settings .
  • But the settings determine what information is sent output.
  • The log settings are specified with the run-time settings dialog, or by using the lr_set_debug_message function.
  • Example : msg_level=lr_get_debug_message( );

lr_log_message :

  • lr_log_message function sends a message to the Vuser or agent log file (depending on the application), and not to the output window.
  • So you can use this function for debugging by sending error or other informational messages to the log file.
  • But in a standalone program such as VuGen, lr_log_message sends the message to the viewer and output.txt.
  • Example : lr_log_message ("login failed: %s", abort);}

lr_output_message :

  • lr_output_message function sends a message with the script section and line number to output windows, log files, and other test report summaries.
  • Example : lr_output_message( "We are on iteration #%s", lr_eval_string( "{iteration}" ) );

lr_set_debug_message :

  • lr_set_debug_message function changes the debug message level bitmap.
  • The message level is initially set in the script's Run-time Settings dialog box.
  • lr_set_debug_message changes the message level from the current value.
  • So, the message level in effect is the result of the Run-time Settings and all previous calls to lr_set_debug_message.
  • Example : lr_set_debug_message(LR_MSG_CLASS_EXTENDED_LOG | LR_MSG_CLASS_FULL_TRACE, LR_SWITCH_OFF );

lr_vuser_status_message :

  • lr_vuser_status_message function sends a string to the Status area of the Controller.
  • But it will also sends the string to the Vuser log. When run from VuGen, the message is sent to output.txt.
  • Example : lr_vuser_status_message( "We are on iteration #%s", lr_eval_string( "{iteration}" ) );

lr_message :

  • lr_message function sends a message to the log file and output window.
  • When run in VuGen, the output file is output.txt.
  • So use the lr_log_message instead of this function to send the message only to the log file.
  • Example : lr_message ("login failed: %s", abort);}

Click Here to see all the transaction function present in loadrunner.

One thought on “Message Functions Present in Loadrunner

Leave a Reply

Your email address will not be published. Required fields are marked *