lr_output_message

Sends a message to log files, output windows, and other test report summaries.

C Language

int lr_output_message( char *format, exp1, exp2,...expn.);
Example: lr_output_messageMessage Functions

Java Language

int lr.output_message( String message ); 
Example: lr.output_messageMessage FunctionsJava Syntax

Arguments

NameComments

format
C Language

A formatted string. If it is a literal string, enclose it with quotation marks. Use the standard Message Formatting that is available for printf to set the format for the expressions you want to print.
exp1, exp2,.. expn
C Language
The expressions (variables) to be formatted and printed.

message
Object Oriented

A string containing the message to send to the Output window. See Java String Arguments.

The lr_output_message function sends a message with the script section and line number to output windows, log files, and other test report summaries.

For details regarding the output for each product, see the products' user guides.

When a script is run in VuGen, the output file is output.txt.

Note:  

  • The output message will be trimmed if the message size is greater than 5 KB.
  • The output message is always displayed in the output window, regardless of whether Enable logging in the runtime settings is checked or unchecked.

To send an error message to the output window , use the lr_error_message function. It is not recommended that you send a message to the output window or agent log in the middle of a transaction, as it will lengthen the execution time. To send a message to the log but not to the Output window, use lr_log_message.

To issue a message without including the location details, use lr_message.

statement

Output

lr.log_message("a message") a message
lr.output_message("a message"); Actions.java (4): a message

Note: Do not send null pointers as arguments to string formats e.g.
     char *str = NULL;
     lr_output_message("%s", str);

Return Values

If this function succeeds, it returns the length of the message that was sent. If the function fails, it returns a negative number.

Parameterization

You cannot use standard parameterization for any arguments in this function.

Concept Link IconSee Also