loadrunnertruclient

Password Encryption in Loadrunner TruClient Ajax script


I have recorded a script using Loadrunner Truclient Ajax Protocol. It generated code something like this.

Script_View_Action()
{
truclient_step("Navigate to 'test-adept2'", "snapshot=Action_21.inf");
{
    truclient_step("Navigate to 'test-adept2'", "snapshot=Action_21.1.inf");
    truclient_step("Enter credentials in authentication dialog", "snapshot=Action_21.2.inf");
}

and so on... I have provided credentials in the Argument Tab.

enter image description here

However, I am not able to figure out, how to provide encrypted password in the argument. Since there is no explicit code in this code where I can use lr_encrypt()/ lr_decrypt functions.


Solution

  • Since TruClient scripts are developed in JavaScript you need to do the JavaScript equivalent to lr_encrypt and lr_decrypt.

    In the Password argument in TruClient plugin use LR.decrypt(<my encrypted password>); (see the product help for more information). You didn't write which version you are using so I leave to you to figure out how to tell TruClient to use JavaScript instead of plain text in argument values (again, the help will be of use here).