Global Send Keys and Send Key Events

PmcLain

New Member
Hi all,

I'm trying to use send keys to zoom in to a page but can't seem to figure it out. The page is not a webpage, but a citrix remote screen. I've tried "^{ADD}" hoping that would solve it but had no luck.

Thanks
 

zbalint

New Member
I have a string variable that contains a url. It works most of the time, except when I use global send key events to navigate an existing open Chrome window.
In that case if the system keyboard layout is 'US English' then it types '/3' instead of '/#'.
The robot environment by default is set to US English keyboard layout.

I wonder why this happens? As far as I know the forward slash is not a special character to the global send keys events.
The '/#' is in the middle of the URL, and everything else is typed correctly.
Globals send keys events activates the browser navigation with F6 and having typed it, it sends the URL with {Enter}. So everything works, except the middle, where it is supposed to just type literally the /#.

Any ideas?
 

sahil_raina_91

Active Member
I have a string variable that contains a url. It works most of the time, except when I use global send key events to navigate an existing open Chrome window.
In that case if the system keyboard layout is 'US English' then it types '/3' instead of '/#'.
The robot environment by default is set to US English keyboard layout.

I wonder why this happens? As far as I know the forward slash is not a special character to the global send keys events.
The '/#' is in the middle of the URL, and everything else is typed correctly.
Globals send keys events activates the browser navigation with F6 and having typed it, it sends the URL with {Enter}. So everything works, except the middle, where it is supposed to just type literally the /#.

Any ideas?

That's how send key events work. GSK Events in Blue Prism simulate the keyboard.
You will need to do a SHIFT+3 to send #

To type a URL > use send keys instead of send key events
 

Sravani Kovuru

New Member
Send Keys and Send Key Events

Where a technical interface is unavailable for an application or an element within an application a Write stage
might not work as a method of inputting text into screen elements. Where that is the case Blue Prism provide two
text input methods that will work with any application:

Global Send keys
Send Keys will work for most applications and should be tried before Send Key Events. It is a higher-level
interface that sends keystrokes to the active application.

Global Send Key events
Send Key Events will work for all applications and is the text sending method recommended for Citrix
applications. It is a lower-level interface that mimics keyboard keystrokes in the operating system.
Send Keys and Send Key Events are part of the interface techniques that make up the Blue Prism Surface
Automation interface.

Unlike other interfaces where a write stage will populate an element with text even when that element is not
visible, there are some factors that need to be in place for Global Send Key interfaces to work robustly:

• The desktop screen must exist and be persistent. Send Key interfaces will not work if the desktop screen is
locked or a screensaver is displayed
• The window that you want to send text into must be activated to be the topmost window of all running
applications
• The element within the window you want to send text into must be focused so that the keyboard cursor is
within it ready to enter text
• To ensure the application has time to react to any window or element focus navigation tiny delays are
required between window activates, element clicks, and using Send Keys
• To ensure text is entered reliable a tiny delay should be placed between each keystroke. Experience in the
use of Send Keys interfaces has shown that for some applications entering text too quickly can result in
some characters not being correctly entered.

When to use Send Keys or Send Key Events

Global keystrokes should be used when other methods of inputting text do not work, either because a thin client technology such as Citrix is being used, or because the element within an application either cannot be identified by application modeller or does not accept the use of a write stage.
If one interface method of sending text to an application does not work a developer should move onto trying a different method until a technique that works is found.

Different methods of entering test into an application should be attempted in the following order:

1. Write stage. Sending text using a write stage uses technological interfaces specific for the application type.
2. Windows Press Keys. For some applications this action in a navigate stage will work to send text. None of the window activation or element focus methods mentioned in this document are required.
3. Global Send Keys. This option should be tried before Global Send Keys because it is a higher level interface and easier to use control keys.
4. Global Send Key events. This is the final option and should always work. It is the only option that will work when interfacing with Citrix applications. Even where Global Send Keys works this option can be useful for some use cases where a key needs to be held down on it’s own whilst other actions are performed.



Blue Prism version 6 included some major improvements in the Surface Automation interfaces to make it far easier to implement the techniques required to robustly use Global Send Keys.
This image is of a version 6 navigate stage using the Global Send Keys action:

View attachment 1200

This Blue Prism version 6 navigate stage contains all the actions required for Global Send Keys to work robustly:
1. The Main Window of the application is brought to focus using the Activate Application action
2. The edit or text box we want to send keystrokes to is made active by using a Global Mouse Click Centre action
3. Global Send Keys to send the data to the application. The Input parameters to this action is the text we want to send and the interval between keystrokes which has been set to be 0.1 seconds
4. The ‘Pause After Each Step’ setting to 0.25 seconds. The correct pause number to for your own interface will depend upon the responsiveness of applications within your environment. This will usually be a number between 0.25 and 1 seconds.

Using Global Send Keys with Blue Prism version 5 or earlier
In earlier versions of Blue Prism the actions required to robustly use Global Send Keys could not be implemented in a single navigate stage. Instead the object flow to use send keys would look like the following images:
View attachment 1201
Send Key and Send Key Events Syntax
When sending text using Global Send Keys and Global Send Key events there is a specific text format that must be used when sending control keys such as function keys, Shift, Alt, or Ctrl.
The different syntaxes are fully described in the sections below. However, the following table is a quick cheat sheet is offered which explains both quickly.
Cheat Sheet:
View attachment 1202

Send Keys
Send Keys talks directly to the application that an object is connected to. This method uses the following mnemonics to indicate for the Shift, Control and Alt keys:
• Shift: +
• Control: ^
• Alt: %
Special keys like for example Home must always be enclosed in braces. i.e. {HOME}.
To specify that any combination of Shift, Control and Alt should be held down while several other keys are pressed, enclose the code for those keys in parentheses. I.e. to specify to hold down Shift while E and C are pressed, use "+(EC)". On the other hand, to tell the application to hold down Shift while E is pressed followed by C without Shift, use "+EC".
Send Keys offers the option to repeat a key press a given number of times. For such functionality the number of times must appear after the name of the key. I.e. {LEFT 10} tells Send Keys to press the Left arrow key 10 times.

View attachment 1203
Hope You got required Information.
Thank you so much for clear explanation.
I am facing an issue while using global send keys in sap application.
The focus is going to the windows search button and it is writing the entire text there instead of writing in the text field.

Can someone please help on this?
I am using focus to the text field and then global send keys
 
Last edited:

Ny.x

New Member
What is the Global Send Keys and Send Key Events ?

Why we need Global Send Keys and Send Key Events ?

When we have to use Global Send Keys and Send Key Events ?

How to Implement Global Send Keys and Send Key Events ?

Please give Real Time Usage Global Send Keys and Send Key Events with examples
Blue Prism have a data sheet on this very topic, its will have all the answers to your questions 1644497981565.png
 
Top