Share this page

# lr.outputMessage

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

Message Functions

## Syntax

                lr.outputMessage( message );

## Arguments

Argument | Comments
--- | ---
message | A string containing the message to send to the output window.

The lr.outputMessage 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 or log, use the lr.errorMessage 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.logMessage.

To send a message to the output file, you must enable logging in the runtime 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.logMessage("a message") | a message
lr.outputMessage("a message"); | actions (4): a message

Note: Do not pass an empty string as the message argument.

## Return Values

On success, returns the length of the message that was sent. On failure, returns a negative number.

## Parameterization

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

## Example

     lr.outputMessage("We are on iteration " + lr.evalString( "{iteration}" ));

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: