Skip to main content

Click Element

Clicks on an element in a web 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 - The id of the webpage to click element on. This ID is generated by the Open Browser node.
  • Selector Type - The type of selector to use. The options are "XPath" and "CSS".
  • Selector - The selector of the element to click on.

Options

  • Wait Timeout (sec) - The time in seconds that Click Element will wait for the element to be visible before throwing an error.
  • Click Type - The type of click that will be performed on the element. The options are "Single Click", "Double Click", "Right Click", "Middle Click", "Hold Click", and "Release Click".

How It Works

  1. The node receives the Page ID and waits for any configured delay before execution
  2. It validates that the Page ID and Selector are not empty
  3. It retrieves the active browser page session using the Page ID
  4. The node waits for the element to appear on the page (up to the Wait Timeout duration)
  5. For Safari browsers, it uses JavaScript execution to perform the click
  6. For other browsers (Chrome, Firefox, Edge), it locates the element using the provided selector
  7. Based on the Click Type option, it performs the appropriate click action on the element
  8. 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
  • The target element must be clickable and visible on the page
  • The element must appear within the specified Wait Timeout period

Error Handling

Error CodeDescription
Core.Browser.ClickElement.ErrOnCreateConfiguration parsing error during node creation
Core.Browser.ClickElement.OnMessageError parsing incoming message data
Core.Browser.ClickElement.ErrPageIdPage ID is empty or not provided
Core.Browser.ClickElement.ErrSessionInvalid or expired Page ID, session not found
Core.Browser.ClickElement.ErrSelectorSelector is empty or not provided
Core.Browser.ClickElement.InvalidFieldInvalid value for Wait Timeout field
Core.Browser.ClickElement.WaitElementElement not found within the specified timeout period
Core.Browser.ClickElement.ErrElementsFailed to retrieve element from selection
Core.Browser.ClickElement.ErrClickFailed to perform single click
Core.Browser.ClickElement.ErrDoubleClickFailed to perform double click
Core.Browser.ClickElement.ErrRightClickFailed to perform right click
Core.Browser.ClickElement.ErrMiddleClickFailed to perform middle click
Core.Browser.ClickElement.ErrHoldClickFailed to hold click
Core.Browser.ClickElement.ErrReleaseClickFailed to release click
Core.Browser.ClickElement.ErrMoveMouseFailed to move mouse to element
Core.Browser.ClickElement.ClickTypeUnknown click type selected
Core.Browser.ClickElement.ErrForwardFailed to execute click script (Safari)

Usage Examples

Example 1: Clicking a Submit Button

When automating form submission:

1. Use Type Text or Set Value nodes to fill form fields
2. Use Click Element with:
- Selector Type: CSS
- Selector: button[type="submit"]
- Click Type: Single Click
- Wait Timeout: 10 seconds
3. Continue with form submission handling

Example 2: Opening Context Menu

When you need to access a right-click context menu:

1. Use Click Element with:
- Selector Type: XPath
- Selector: //div[@class='file-item']
- Click Type: Right Click
- Wait Timeout: 5 seconds
2. Use another Click Element to select an option from the context menu
3. Continue with your automation flow

Example 3: Drag and Drop Operation

When implementing drag and drop functionality:

1. Use Click Element on the source element with:
- Click Type: Hold Click
- Wait Timeout: 5 seconds
2. Use Move to Element to move to the target location
3. Use Click Element with:
- Click Type: Release Click
- Selector: (target element selector)
4. Complete the drag and drop operation

Usage Notes

  • The node automatically waits for the element to appear before attempting to click
  • For Safari browsers, clicks are performed using JavaScript, which may behave differently than native clicks
  • Hold Click and Release Click must be used in pairs for drag and drop operations
  • Right Click and Middle Click first move the mouse to the element, then perform the click
  • If the element is not visible or is covered by another element, the click may fail
  • The Wait Timeout should be long enough for dynamic content to load
  • Single Click is the most commonly used click type for standard interactions

Tips

  • Use CSS selectors when possible as they are generally faster than XPath
  • Increase Wait Timeout for elements that load slowly or require API calls
  • Use the browser's developer tools to test and verify your selectors
  • For elements that appear after page interactions, add appropriate Wait Timeout values
  • If clicks are not registering, try adding a small Delay Before to allow page stabilization
  • Consider using Wait Element node before Click Element for better control over element readiness
  • For debugging, enable Continue On Error temporarily and check element visibility manually