Digital Exchange

Expand all | Collapse all

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

Jump to Best Answer
  • 1.  How to use Global Send Keys with a Password Including Special Keys

    Posted 08-29-2019 12:01

    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.


  • 2.  RE: How to use Global Send Keys with a Password Including Special Keys
    Best Answer

    Posted 02-24-2020 14:22
    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
    ------------------------------



  • 3.  RE: How to use Global Send Keys with a Password Including Special Keys

    Posted 06-16-2020 16:19
    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
    ------------------------------



  • 4.  RE: How to use Global Send Keys with a Password Including Special Keys

    Posted 02-28-2020 07:35
    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.
    ------------------------------