Share this page

# lr.unmask

Unmasks an encoded string during replay.

## C#

    string lr.unmask( String EncodedString );

## VB.NET

    Function lr.unmask( ByVal EncodedString As String  ) as String

String and Parameter Functions

## Arguments

Name | Comments
--- | ---
EncodedString | The encoded string you want to unmask.

The lr.unmask function unmasks an encoded string. One common way to use this function is to provide a password to a function without entering the literal password in the script. When you run the script, the test run component decodes the password.

It is possible to create an lr.unmask call from a value in a script. Select an entire string between quote marks, not including the quote marks themselves. Right-click in the selected string and select Mask String. The original string is replaced with an lr.unmask call where the EncodedString argument is the original string after encoding.

To get an encoded value for later use, copy the value. Then go to Windows Start menu > Password Encoder. Paste the value into the Password field, and click Generate. The masked string appears in the Encoded String box. Click Copy and paste the masked string into a parameter for later use, or assign the value to a string variable.

## Return Values

The decoded string. If decode fails, returns null.

## Parameterization

All string input arguments can be passed using standard parameterization.

## Example

In the following example, the Vuser logs in using the unmasked password.

Copy code

    public int login(string username, string password)
    {
    //emulate failed login
    return lr.FAIL;
    }
    Login("johndoe",lr.unmask("51a4773864c35bd616a30d98"));

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: