Send Keys
Sends specified keys to the current targeted web element in the page.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
if ContinueOnError property is true, no error is caught when the project is executed even if Catch node is used.
Input
- Page Id - ID of the current page. This ID is generated by the Open Link node.
- Selector Type - XPath or CSS selector of the targeted web element.
- Selector - Custom selector
- Key - Key to be sent to the element.
Options
- Key Modifier 1 - Modifier key to be pressed
- Key Modifier 2 - Modifier key to be pressed
- Key Modifier 3 - Modifier key to be pressed
info
If you want to send Ctrl + c to an element. Key should be c and Key Modifier 1 should be Control. If you want to send Ctrl + Alt + x to an element. Key should be x and Key Modifier 1 should be Control and Key Modifier 2 should be Alt.
How It Works
- The node receives the Page ID, Selector Type, Selector, Key, and Key Modifiers
- It validates that the Page ID and Selector are not empty
- It waits for any configured delay before execution
- It retrieves the active page session using the provided Page ID
- The node waits for the target element to appear on the page
- Once the element is located, it validates that at least one key or modifier is specified
- It constructs the key combination from modifiers (Modifier 1, 2, 3) and the main key
- The node sends the key combination to the element
- The node applies any configured delay after execution
Requirements
- An active browser session created by the Open Browser node
- A valid Page ID from the Open Browser node
- A valid CSS or XPath selector that uniquely identifies the target element
- At least one key or modifier key must be specified
- The key parameter can only contain a single character
- The element must be focusable and able to receive keyboard input
Error Handling
| Error Code | Description |
|---|---|
| Core.Browser.SendKey.ErrOnCreate | Configuration parsing error during node creation |
| Core.Browser.SendKey.ErrOnMessage | Error parsing incoming message data |
| Core.Browser.SendKey.ErrPageId | Page ID is empty or not provided |
| Core.Browser.SendKeys.ErrSession | Invalid or expired Page ID, session not found |
| Core.Browser.SendKeys.ErrSelector | Selector is empty or not provided |
| Core.Browser.SendKeys.InvalidKey | Key contains more than one character |
| Core.Browser.SendKeys.InvalidField | Invalid value for Wait Timeout field |
| Core.Browser.SendKeys.WaitElement | Element not found within the specified timeout period |
| Core.Browser.SendKeys.ErrElements | Failed to retrieve element from selection |
| Core.Browser.SendKeys.KeyType | No key or modifier key was selected |
Usage Examples
Example 1: Copying Text with Ctrl+C
When automating clipboard operations:
1. Use Open Browser and navigate to a page
2. Use Click Element to focus on text element
3. Use Send Keys with:
- Selector Type: CSS
- Selector: textarea[name="content"]
- Key: c
- Key Modifier 1: Control
4. The text is copied to clipboard
5. Continue with paste or other operations
Example 2: Form Submission with Enter Key
When submitting forms via keyboard:
1. Navigate to a form page
2. Fill in form fields using Type Text
3. Use Send Keys to the last input field with:
- Key Modifier 1: Enter (set as main key, not modifier)
4. Form submits as if Enter key was pressed
5. Continue with form submission handling
Example 3: Navigation with Arrow Keys
When navigating through UI elements using keyboard:
1. Focus on a navigable element (list, menu, etc.)
2. Use Send Keys with:
- Key Modifier 1: Arrow Down
3. Selection moves to next item
4. Repeat to navigate through multiple items
5. Use Enter to select the highlighted item
Usage Notes
- The Key parameter accepts only a single character (a-z, 0-9, etc.)
- Modifier keys include: Control, Alt, Shift, Enter, Escape, Arrow keys, Function keys, etc.
- Up to 3 modifier keys can be combined with the main key
- The order of modifiers doesn't matter
- Special keys (F1-F12, arrows, etc.) should be used as modifiers, not as the main key
- Send Keys works on focused or focusable elements
- Some key combinations may be intercepted by the browser or OS
- For regular text input, use Type Text node instead
Available Keys
Supported modifier keys include:
- Control, Alt, Shift
- Enter, Tab, Escape, Space, Backspace, Delete
- Arrow keys (Left, Right, Up, Down)
- Page Up, Page Down, Home, End
- Insert, Pause
- F1 through F12
- Command/Windows/Meta key
Tips
- Use Type Text for regular text input; Send Keys is for special key combinations
- Test key combinations as some may be browser-specific
- On macOS, use Command key instead of Control for standard shortcuts
- Add a small Delay After for actions triggered by key combinations
- Use Click Element first to ensure the element is focused
- For keyboard navigation, verify element is focusable
- Some web applications may not respond to all key combinations
- Debug using browser console to verify key events are being received
Related Nodes
- Open Browser - Creates the browser session and Page ID
- Type Text - Types regular text into elements
- Click Element - Focuses elements before sending keys
- Wait Element - Ensures elements are ready for keyboard input
- Set Value - Sets values without keyboard simulation