(or TypeObfuscated or TypeUnLogged or TypeSecret)

When I log into software on a SUT, I often have to pass a password, one which I may or may not want visible in the logs, or even in the script file itself.

One way is to SetRemoteClipboard, and then TypeCommand-V, but that won’t work in many password fields (like Apple’s screen saver).

So, looking for a way to Type- something, without exposing it’s contents in the log or script file itself?

I could really use this type of function too. Many thanks, Bruce

It looks like we should have come back and posted here earlier…

In version 1.4, we added the SetLogging command to address this need. So, for example, you could write your own TypeUnLogged command, like this:

-- this is my TypeUnLogged command script
params secretStuffToType
put loggingIsOn() into initialLoggingState
SetLogging Off
TypeText secretStuffToType
SetLogging initialLoggingState -- restore it to what it was

The code above will keep the password out of the log file, but it will still be visible in your script where you call the command, like this:

TypeUnLogged "myverysecretpassword"

To avoid this, your script might read the password from a file:

put line 1 of file "~/path/mySecretPasswordFile" into password
TypeUnLogged password

Or, your script could prompt for the password each time it is run:

ask password "Enter the Secret Password:"
TypeUnLogged it

I hope that helps! There are other ways you could hide a password, too, but these are probably the simplest.