JavaScript Functions > Alphabetical Listing of Utility Functions (lr) > lr.decrypt

lr.decrypt

Decrypts an encoded string

Example String and Parameter Functions

Syntax

lr.decrypt( EncodedString );

Arguments

Argument Comments
EncodedString The encoded string to decrypt.

The lr.decrypt function decrypts an encoded string. This function is generated during recording to encode passwords. VuGen records the actual password but displays an encoded version of the password within the lr.decrypt function.

When you run the script, the test run component decrypts the password. Each time you record, VuGen encrypts the password differently, even when you use the same password.

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

To get an encrypted value from a recorded value for later use:

  1. Copy the recorded value. Run Start >Programs > LoadRunner > Tools > password Encoder.
  2. Paste the value into the password field, and click Generate. The encrypted string appears in the Encodedstring box.
  3. Click the Copy button.
  4. Paste the encrypted string into a parameter for later use, or assign the value to a string variable.

VuGen uses 32-bit encryption.

Return Values

Returns the decoded string. On error, returns null.

Parameterization

Parameterization is not applicable to the argument of this function. To apply parameterization, use lr.evalString.

Example

lr.outputMessage(lr.decrypt("38620da61ca1093e7aa7ec"));