Friday, June 7, 2013

How to encrypt a string in Loadrunner using password encoder? How to use the encrypted value in script?

Suppose you face a situation, when you want to encrypt your password and use this value in script. This is a cake walk.

You have to go to password encoder, the Password Encoder tool lets you enter regular text and convert it to an encoded string.

Choose Start > Programs > LoadRunner > Tools >Password Encoder to open the Password Encoder tool.



Password: Enter the password you want to encode, and then click Generate.
Encoded string: Displays the encoded password string.
Generate: Generates an encoded string after a password is entered.
Copy: Copies the encoded password string to the clipboard.

Done!!!

Now, How to use the encrypted value in script?

This is done by using lr_decrypt function as shown below in script.

vuser_init()
{
    web_set_proxy("oregon:8080");
    web_set_user("oregon_user",

    lr_decrypt("518a296870b8b8d477e2f63cbbe5f2a0")," oregon:8080");
    web_url("web_url",
        "URL=http:// oregoncity.com /",
        "TargetFrame=",
        "Resource=0",
        "Referer=",
        LAST );

}

No comments:

Post a Comment