Send Keys
Sends all the characters from Keys to the specified element. When the workflow is run using Google Chrome extension, the characters are sent one by one simulating the user actions. For instance, if we want to get the popup suggestions, the validations to work or the username, password fields to behave as expected, it is advisable to use SendKeys.
#
Designer PropertiesSee Web Event Main Properties.
Keys The Keys to sent to the web element. If we want to send just characters, we just type them under "". We use "" because we can have expressions like concatenations, or we can call functions like Replace for instance. In order to use raw keys, like Control, we need to group them under {Keys....}. For instance, if we want to send Ctrl + S the expression should look like: {Keys.Control + s + Keys.Control} which is translated as:
- { Start of raw key sequence
- Keys.Control Send key down with key Control
- + keys separator
- S Send S key press
- Keys.Control Send key up with key Control
- } Close Raw keys sequence.
If we wanted to send another sequence, we just add that sequence after the first one like {Keys.Control + s + Keys.Control}{Keys.Control + s + Keys.Control} Test. In this case, we will send CTRL + S twice followed by space and 'Test'
To escape a {, } or +, just use {{, }} or ++. To simulate Return key we can just use the new line(\n) character which can be entered by pressing Enter key in the expression editor.
Please check the Virtual keys for all the possible keys that can be used in combination with the keyword Keys.
#
Properties#
Web Event Main PropertiesSee Designer Properties above.
#
General PropertiesSee Web Event General Properties.
#
MiscSee Misc.
#
Out ErrorSee Out Error.
#
Out Properties#
Web Event Advanced PropertiesSee Web Event Advanced Properties.
#
Virtual KeysThe following keys can be used to send raw keys to a control. They just need to be prefixed by Keys keyword and placed under {} as described above in Keyboard Properties.
When running with "Chrome/Edge extension", the following extra keys can be used
For "Web Driver", the following extra keys can be used
#
ExampleSearch for a stock index using Google
In this example, we use send keys to search for a stock index in Google.