Encrypt and Decrypt the password in UFT

In most of the scenarios, we require password to login into the application or database or in any tool.It is good practice not to expose the password in the script or data input. To achieve that, we can encrypt the password and use that encrypted password as input.

We will see how to encrypt and decrypt the password.

Password Encryption: Password can be encrypted in 2 ways in UFT.

1. Using the UFT in-built utility
2. Using Encrypt method

UFT in-built encryption tool: To access this go to the path – “C:\Program Files (x86)\HP\Unified Functional Testing\bin\CryptonApp.exe”

Write your password in ‘Password box’ and click on  Generate.You will get a encoded string i.e. encoded password.
That can be used to in place of actual password.

PasswordEncoder

 

SetSecure method is used to set the encoded password as shown below. We are logging into the UFT sample application ‘Flight GUI’.

LoginWindow

Encrypt Method: There is an object called ‘Crypt’ which contains a method ‘Encrypt’. By using this, we can encode the password.


Password Decryption: Decryption is possible in 2 ways.

1. Using GetRoProperty
2. Using the Input box

Using GetRoProperty: Using the GetRoProperty we can read the value of password field back. Take an example of gmail password editbox. We are typing the value in password field and reading it back.

Using Inputbox: Open a notebook and write “InputBox “Show decrypted password in text box”, “Decrypt Password and save the file with the extension .vbs. We have given a name DecodePassword.

PasswordWindow

Conditional statements
Visual Relationship identifier in UFT
Shekhar Sharma

Shekhar Sharma

Shekhar Sharma is founder of testingpool.com. He is an automation engineer having more than 8 years of experience who loves troubleshooting in automation and finding innovative ways to solve the problems. His other leisurely activities includes playing harmonica, paintings, sketching portrait, watching movies and travelling etc.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *