Share this page

# lr.output_message

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

## C#

    void lr.output_message( String message );

## VB.NET

    Sub lr.output_message( ByVal message As String )

Message Functions

## Arguments

Name | Comments
--- | ---
message | The text to output.

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 or log, 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 thelog but not the output window, use lr.log_message.

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.log_message("a message") | a message
lr.output_message("a message"); | Actions (4): a message

## Return Values

No value returned.

## Parameterization

Standard parameterization is not available for this function.

## Example

The following example sends an output message if the login failed.

Copy code

    public int login(string username, string password)
    {
    //emulate failed login
    return lr.FAIL;
    }
    int status = login("username","password");

    if (status == lr.FAIL) {
      string strOutputMsg="Error: Unable to login to server"
     lr.output_message(strOutputMsg);
    }

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: