Utility Functions and C Language Reference > Utility Functions: Java (lr.) > Alphabetical Listing > lr_output_message

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_message Message Functions

Java Language

int lr.output_message( String message ); 
Example: lr.output_message Message Functions Java Syntax

Arguments

Name Comments
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.

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 send a message to the output file, you must enable logging in the run-time settings, and select Always send messages. If you select Send messages only when an error occurs, there is no output from this function.

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