The only method available is the SetSecure method which internally decrypts the value and sets it in the password fields.
The trick here is to use SetSecure method to decrypt the password but instead of entering the decrypted value in a password field (which displays text as ***), we will enter the value in a normal text field (which will display the text to the user in readable format). Lets see how this can be done.
Our Approach to Decrypt Password (In Brief)
b) Create a VBScript InputBox.
c) Use the SetSecure method to write the decrypted value in the text field inside the InputBox
Detailed Steps to Decrypt Password
Encrypted String for Password – qwerty |
b) Now the next step is to create an InputBox. To do this, write the following text in a notepad -
InputBox “The text box below displays the Decrypted Password”, “Decrypt Password”
InputBox to display the Decrypted (original) Password |
c) The final step is to use SetSecure method to display the original password in the InputBox. For this write the following code in QTP.
1 2 3 4 5 |
SystemUtil.Run “D:DecryptPwd.vbs” 'Type the decrypted password in WinEdit field of InputBox Dialog( "nativeclass:=#32770" , "text:=Decrypt Password" ).WinEdit( "nativeclass:=Edit" ).SetSecure "4e63eb23edd909f721d59eaa98fecb6d82a7" |
The InputBox displays the original password – qwerty |