Share this page

# lr.abort

Aborts the execution of a script.

## C#

    void lr.abort( );

## VB.NET

    Sub lr.abort( )

Runtime Functions

The lr.abort function aborts the execution of a script . It stops the execution of the Actions section, executes the vuser_end section, and ends the execution. This function is useful when you need to manually abort a run as a result of a specific error condition. When you end a run using this function, the status is "Stopped."

This function is not recorded—you insert it manually into your script.

## Return Values

No value returned.

## Parameterization

Parameterization is not applicable to this function.

## Example

The following example aborts the run if the login failed.

Copy code

    int status = login("username","password");
    if (status == lr.FAIL) {
    lr.abort();
    return -1;
    }

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

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: