Mouse Click
Clicks on a specified location on the screen.
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 the ContinuenOnError property is true, no error is caught when the project is executed even if the Catch node is used.
Input
- X Coordinate - The x coordinate of the location on the screen where the click should occur.
- Y Coordinate - The y coordinate of the location on the screen where the click should occur.
Options
- Mouse Button - The mouse button to be used for the click. Available options:
- Left
- Center
- Right
- Click Type - The type of click to be performed. Available options:
- Single Click
- Double Click
- Button Press (press and hold)
- Button Release (release held button)
- Press Down (deprecated, same as Button Press)
- Press Release (deprecated, same as Button Release)
- Key Modifier - The key modifier to be used while performing the click (e.g., shift, ctrl, alt).
How It Works
The Mouse Click node simulates mouse clicks at specified screen coordinates. The execution follows these steps:
- Delay Before - Waits for the specified delay before execution (if configured)
- Button Type Validation - Validates that the mouse button type is one of: left, center, or right
- Coordinate Retrieval - Retrieves the X and Y coordinates from input variables
- Coordinate Validation - Ensures X and Y are non-negative values
- Mouse Movement - Moves the mouse to the specified coordinates (if X > 0 or Y > 0)
- If both X and Y are 0, clicks at the current mouse position without moving
- Key Modifier Press - If a key modifier is specified, holds down that key
- Click Execution - Performs the click based on the click type:
- Single-click: One click with the specified button
- Double-click: Two rapid clicks with the specified button
- Button-press/Press-down: Holds the button down without releasing
- Button-release/Press-release: Releases a held button
- Key Modifier Release - Releases any key modifier that was pressed
- Delay After - Waits for the specified delay after execution (if configured)
Requirements
- Robomotion Deskbot - This node only works with Robomotion Deskbot (desktop automation)
- Screen Coordinates - Valid screen coordinates within your display resolution
- Operating System Support - Compatible with Windows, macOS, and Linux
- Permissions - May require accessibility permissions on macOS and some Linux distributions
- Display Setup - For multi-monitor setups, coordinates are relative to the primary display
Error Handling
| Error Code | Description | Common Cause |
|---|---|---|
Core.Mouse.Click.ErrOnCreate | Configuration parse error | Invalid node configuration or corrupted flow |
Core.Mouse.Click.ErrOnMessage | Message parse error | Invalid input message format |
Core.Mouse.Click.ErrButtonType | Invalid button type | Button type is not one of: left, center, right |
Core.Mouse.Click.ErrClickType | Invalid click type | Click type is not recognized |
Core.Mouse.Click.ErrXY | Invalid coordinates | X or Y coordinate is negative |
Usage Examples
Example 1: Click Submit Button
Click a submit button at specific coordinates:
X Coordinate: 850
Y Coordinate: 520
Mouse Button: Left
Click Type: Single Click
Key Modifier: (empty)
Example 2: Right-Click for Context Menu
Right-click to open a context menu:
X Coordinate: 400
Y Coordinate: 300
Mouse Button: Right
Click Type: Single Click
Key Modifier: (empty)
Example 3: Ctrl+Click for Multi-Select
Click while holding Ctrl to select multiple items:
X Coordinate: {{itemX}}
Y Coordinate: {{itemY}}
Mouse Button: Left
Click Type: Single Click
Key Modifier: ctrl
Example 4: Double-Click to Open File
Double-click to open a file or folder:
X Coordinate: 600
Y Coordinate: 400
Mouse Button: Left
Click Type: Double Click
Key Modifier: (empty)
Example 5: Click at Current Position
Click at the current mouse position without moving:
X Coordinate: 0
Y Coordinate: 0
Mouse Button: Left
Click Type: Single Click
Key Modifier: (empty)
Usage Notes
- Zero Coordinates - When both X and Y are 0, the node clicks at the current mouse position without moving
- Coordinate System - Screen coordinates start at (0,0) in the top-left corner
- Multi-Monitor - For multi-monitor setups, use absolute coordinates relative to the primary display
- Key Modifiers - Common modifiers include: shift, ctrl, alt, command (macOS)
- Press and Hold - Use "Button Press" to start a drag operation, then use "Button Release" to complete it
- Deprecated Options - "Press Down" and "Press Release" are deprecated; use "Button Press" and "Button Release" instead
Tips
- Screen Capture - Use screen capture tools to identify exact coordinates for UI elements
- Variable Coordinates - Store frequently used coordinates in variables for reusability
- Add Delays - Use "Delay Before" to ensure the UI is ready before clicking
- Error Handling - Enable "Continue On Error" for clicks on potentially unstable or changing UI elements
- Image Detection - For more reliable automation, consider using image detection to find coordinates dynamically
- Resolution Awareness - Be aware that coordinates may differ across different screen resolutions
- Validation - Always validate that coordinates are within your screen bounds before execution
- Modifier Usage - When using key modifiers, ensure the target application supports the specific modifier+click combination
Related Nodes
- Mouse Hover - For hovering over elements without clicking
- Mouse Drag - For drag and drop operations
- Mouse Scroll - For scrolling the mouse wheel
- Send Keys - For sending keyboard shortcuts