| || |
Login to application with encrypted password
I'm attempting to update some code (written with assistance from the wonderful folks here, thank you so much) with additional features and after some less than extensive yet more than cursory Googling into the matter, I am unable to answer the following question.
What is the correct syntax to automate login to a Windows application and entering the password?
I've read about using the password encrypter to encrypt my password and found the code to use if it were a webpage I'm using, but I can't figure out how to use the equivalent SetSecure value in a Windows application.
The code would look something like, based on my understanding of how it would look if it were a browser page I was logging into:
Window("MAINFRAME - EXTRA! X-treme").WinObject("Afx:400000:202b:10005:6:0").Set Secure "encrypted password here" but it doesn't seem to work.
Any help would be greatly appreciated, thanks!
SetSecure is the correct method for entering a encrypted password.
The issue in your statement is that you are trying to use this method against a WinObject.
SetSecure method is only available for WinEdit object type.
Oh, thanks Rajkumar! Is there a winobject equivalent or is the login to the mainframe terminal something that the terminal emulator addin would make simpler? I haven't tried it yet.
You need to install the UFT terminal addin. This will allow you you use encrypted passwords and allow UFT to correctly identify your Mainframe objects instead of recording them as WinObjects.
Originally Posted by mwsrosso
You'll need to make sure to properly setup the terminal addin too - there's a process to make sure the addin can talk to the terminal program using HLLAPI.
Once that's setup, then I would suggest actually using UFT to record yourself logging in. (even if you throw out the generated code). It will let you see how the login process is seen by UFT. You should see it use the .SetSecure method automatically, and it even captures the encrypted version of your password as a string literal in the code (saves you the trouble of using the password encrypter tool)
Also, I recommend carefully grooming your object repository of TEWindows, TEScreens and TEFields. Others here may not agree with me on this one, so I'll just say that. Message me if you want more information on how I do this.