cancel
Showing results for 
Search instead for 
Did you mean: 

How to use Global Send Keys with a Password Including Special Keys

I am trying to enter a password into a Citrix window using global send key events and the username works fine, but I cannot send a password as is. My guess is that I would need to create individual key events for each special character, but that would reveal too much of the password in the design of the action.

Is there another approach?

--------------------------------------------------
Disclaimer: This content was auto-posted from Stackoverflow. The original Stackoverflow question is here Stackoverflow Post, posted by AnotherDeveloper.
Hi  I am a Digital Worker. Please check out my profile to learn more about what I do!
1 BEST ANSWER

Helpful Answers

PaulTrouton
Level 3
I came across the same issue today and was able to solve it by storing the send key events control characters in the password data item in credential manager.

For example, if you wanted your password to be Password1 then you should store the following in the password data item:

<{SHIFT}p>{SHIFT}assword<{SHIFT}1>{SHIFT}

It will all appear encrypted in credential manager and in any password data items, but when you pass that to a navigate stage with send key events, it will correctly enter the password.

------------------------------
Paul Trouton
RPA Lead Developer
Allen & Overy
Europe/London
------------------------------

View answer in original post

3 REPLIES 3

PaulTrouton
Level 3
I came across the same issue today and was able to solve it by storing the send key events control characters in the password data item in credential manager.

For example, if you wanted your password to be Password1 then you should store the following in the password data item:

<{SHIFT}p>{SHIFT}assword<{SHIFT}1>{SHIFT}

It will all appear encrypted in credential manager and in any password data items, but when you pass that to a navigate stage with send key events, it will correctly enter the password.

------------------------------
Paul Trouton
RPA Lead Developer
Allen & Overy
Europe/London
------------------------------

VivekGoel
Level 10
You can replicate the same issue by sending global send key events to RDP window.
The first letter of the password is always a problem with such screens. Hence the approach suggested by Paul can be tried. Please remember the first letter needs to be handled carefully, rest all will be fine.

------------------------------
Vivek Goel
"If you like this post, please press the "Recommend" Button.
------------------------------

Instead of saving the password with the Send Keys command, I have implemented a short code (in C#) to deal with it.
In my case, the code only replaces capital letters to its equivalent command in Send Keys.
So this way, you don't need to worry about the person in charge of credentials to make any mistakes.

String UpperLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
String LowerLetters = "abcdefghijklmnopqrstuvwxyz";

for (int i = 0; i < UpperLetters.Length; i++)
{
	inputString = inputString.Replace(UpperLetters[i].ToString(), "<{#!#}"+LowerLetters[i].ToString()+">{#!#}");
}

inputString = inputString.Replace("#!#", "SHIFT");

outputString = inputString;


------------------------------
Igor Ferreira Pinto
------------------------------