activities
latest
false
UiPath logo, featuring letters U and I in white
UI Automation Activities
Last updated Nov 25, 2024

Click

Clicks a specified UI element, for example a button or a link. Can be configured to use any mouse button, use a double-click.

This API must be added after Open or Attach.

Definition

Namespace: UiPath.UIAutomationNext.API.Models

Assembly: UiPath.UIAutomationNext.API.Models (in UiPath.UIAutomationNext.API.Models dll)

Overloads

OverloadDescription
Click(String, ClickOptions)Clicks a UI element identified by a string in the Object Repository.
Click(IElementDescriptor, ClickOptions)Clicks a UI element identified by a descriptor of an element from Object Repository.
Click(TargetAnchorableModel, ClickOptions)Clicks a target anchorable model, which represents a specific UI element in the application.
Click(RuntimeTarget, ClickOptions)Clicks a UI element identified by a runtime instance of an Object Repository element.
Click(String, NClickType, NMouseButton)Performs a click operation on a UI element identified by a string in the Object Repository, specifying the click type and mouse button.
Click(IElementDescriptor, NClickType, NMouseButton)Clicks a UI element identified by a descriptor of an element from Object Repository, specifying the click type and mouse button.

Click(String, ClickOptions)

Clicks a UI element identified by its string representation.

Click(
    TargetAnchorableModel target, 
    ClickOptions clickOptions)Click(
    TargetAnchorableModel target, 
    ClickOptions clickOptions)
target String
Indicate the UI element captured in the Object Repository that you want to click.
clickOptions ClickOptions
Additional options for customizing the click operation:
  • KeyModifiers NKeyModifiers:
    • None
    • Alt
    • Ctrl
    • Shift
    • Win
  • ClickType NClickType:
    • Single
    • Double
    • Down
    • Up
    For example, to perform a double click you just need to set the click type to NClickType.Double:
    clientAccountsScreen.Click(Descriptors.ACME_System_3.ClientAccountsScreen.AccountRowTest, new ClickOptions(){ClickType = NClickType.Double}.WithVariable("account_number_system1", "407547"));.
  • MouseButton NMouseButton:
    • Left
    • Right
    • Middle
  • CursorMotionType CursorMotionType:
    • Instant - The cursor jumps to the destination.
    • Smooth - The cursor moves in increments.
  • InteractionMode NInteractionMode:
    • HardwareEvents - Simulates the click by using the hardware driver. This is the slowest API, it cannot work in the background, but it is compatible with all desktop apps.
    • SameAsCard - Use the same input mode as the Open or Attach APIs. This is the default selection.
    • Simulate - Simulates the click using accessibility APIs. Recommended in browser automation, Java apps, or SAP. More reliable than Hardware Events. Works even if the target application is not in focus. Please test if your target application UI element supports this.
    • DebuggerApi - Performs actions using debugger APIs. Works for Chromium elements only. Sends all text in one go. Works even if the target application is not in focus. For more details, check out this page.
    • WindowMessages - Simulates using Win32 messages. Recommended for desktop apps. Usually more reliable than Hardware Events. Sends all text in one go. Works even if the target application is not in focus. Before using this API, please test if your target application UI element supports this.

Click(IElementDescriptor, ClickOptions)

Clicks a UI element identified by a descriptor of an element from Object Repository.

Click(
    IElementDescriptor elementDescriptor,
    ClickOptions clickOptions)Click(
    IElementDescriptor elementDescriptor,
    ClickOptions clickOptions)
elementDescriptor IElementDescriptor
The UI element you want to click, identified by a descriptor of an element from Object Repository.
clickOptions ClickOptions
Additional options for customizing the click operation:
  • KeyModifiers NKeyModifiers:
    • None
    • Alt
    • Ctrl
    • Shift
    • Win
  • ClickType NClickType:
    • Single
    • Double
    • Down
    • Up
    For example, to perform a double click you just need to set the click type to NClickType.Double:
    clientAccountsScreen.Click(Descriptors.ACME_System_3.ClientAccountsScreen.AccountRowTest, new ClickOptions(){ClickType = NClickType.Double}.WithVariable("account_number_system1", "407547"));.
  • MouseButton NMouseButton:
    • Left
    • Right
    • Middle
  • CursorMotionType CursorMotionType:
    • Instant - The cursor jumps to the destination.
    • Smooth - The cursor moves in increments.
  • InteractionMode NInteractionMode:
    • HardwareEvents - Simulates the click by using the hardware driver. This is the slowest API, it cannot work in the background, but it is compatible with all desktop apps.
    • SameAsCard - Use the same input mode as the Open or Attach APIs. This is the default selection.
    • Simulate - Simulates the click using accessibility APIs. Recommended in browser automation, Java apps, or SAP. More reliable than Hardware Events. Works even if the target application is not in focus. Please test if your target application UI element supports this.
    • DebuggerApi - Performs actions using debugger APIs. Works for Chromium elements only. Sends all text in one go. Works even if the target application is not in focus. For more details, check out this page.
    • WindowMessages - Simulates using Win32 messages. Recommended for desktop apps. Usually more reliable than Hardware Events. Sends all text in one go. Works even if the target application is not in focus. Before using this API, please test if your target application UI element supports this.

Click(TargetAnchorableModel, ClickOptions)

Clicks a target anchorable model, which represents a specific UI element in the application.

Click(
    TargetAnchorableModel target, 
    ClickOptions clickOptions)Click(
    TargetAnchorableModel target, 
    ClickOptions clickOptions)
target TargetAnchorableModel
The target anchorable model (UI element) that you want to click.
clickOptions ClickOptions
Additional options for customizing the click operation:
  • KeyModifiers NKeyModifiers:
    • None
    • Alt
    • Ctrl
    • Shift
    • Win
  • ClickType NClickType:
    • Single
    • Double
    • Down
    • Up
    For example, to perform a double click you just need to set the click type to NClickType.Double:
    clientAccountsScreen.Click(Descriptors.ACME_System_3.ClientAccountsScreen.AccountRowTest, new ClickOptions(){ClickType = NClickType.Double}.WithVariable("account_number_system1", "407547"));.
  • MouseButton NMouseButton:
    • Left
    • Right
    • Middle
  • CursorMotionType CursorMotionType:
    • Instant - The cursor jumps to the destination.
    • Smooth - The cursor moves in increments.
  • InteractionMode NInteractionMode:
    • HardwareEvents - Simulates the click by using the hardware driver. This is the slowest API, it cannot work in the background, but it is compatible with all desktop apps.
    • SameAsCard - Use the same input mode as the Open or Attach APIs. This is the default selection.
    • Simulate - Simulates the click using accessibility APIs. Recommended in browser automation, Java apps, or SAP. More reliable than Hardware Events. Works even if the target application is not in focus. Please test if your target application UI element supports this.
    • DebuggerApi - Performs actions using debugger APIs. Works for Chromium elements only. Sends all text in one go. Works even if the target application is not in focus. For more details, check out this page.
    • WindowMessages - Simulates using Win32 messages. Recommended for desktop apps. Usually more reliable than Hardware Events. Sends all text in one go. Works even if the target application is not in focus. Before using this API, please test if your target application UI element supports this.

Click(RuntimeTarget, ClickOptions)

Clicks a UI element identified by a runtime instance of an Object Repository element.

Click(
    RuntimeTarget target,
    ClickOptions clickOptions)Click(
    RuntimeTarget target,
    ClickOptions clickOptions)
target RuntimeTarget
The UI element you want to click, identified by a runtime instance of an Object Repository element.
clickOptions ClickOptions
Additional options for customizing the click operation:
  • KeyModifiers NKeyModifiers:
    • None
    • Alt
    • Ctrl
    • Shift
    • Win
  • ClickType NClickType:
    • Single
    • Double
    • Down
    • Up
    For example, to perform a double click you just need to set the click type to NClickType.Double:
    clientAccountsScreen.Click(Descriptors.ACME_System_3.ClientAccountsScreen.AccountRowTest, new ClickOptions(){ClickType = NClickType.Double}.WithVariable("account_number_system1", "407547"));.
  • MouseButton NMouseButton:
    • Left
    • Right
    • Middle
  • CursorMotionType CursorMotionType:
    • Instant - The cursor jumps to the destination.
    • Smooth - The cursor moves in increments.
  • InteractionMode NInteractionMode:
    • HardwareEvents - Simulates the click by using the hardware driver. This is the slowest API, it cannot work in the background, but it is compatible with all desktop apps.
    • SameAsCard - Use the same input mode as the Open or Attach APIs. This is the default selection.
    • Simulate - Simulates the click using accessibility APIs. Recommended in browser automation, Java apps, or SAP. More reliable than Hardware Events. Works even if the target application is not in focus. Please test if your target application UI element supports this.
    • DebuggerApi - Performs actions using debugger APIs. Works for Chromium elements only. Sends all text in one go. Works even if the target application is not in focus. For more details, check out this page.
    • WindowMessages - Simulates using Win32 messages. Recommended for desktop apps. Usually more reliable than Hardware Events. Sends all text in one go. Works even if the target application is not in focus. Before using this API, please test if your target application UI element supports this.

Click(String, NClickType, NMouseButton)

Perform a click operation on a UI element identified by its string representation or selector, specifying the click type and mouse button.

Click(
    string target, 
    NClickType clickType, 
    NMouseButton mouseButton)Click(
    string target, 
    NClickType clickType, 
    NMouseButton mouseButton)
target String
Indicate the UI element captured in the Object Repository that you want to click.
clickType NClickType
The type of click to perform: Single, Double, Down, or Up. The default option is Single.
For example, to perform a double click you just need to set the click type to NClickType.Double:clientAccountsScreen.Click(Descriptors.ACME_System_3.ClientAccountsScreen.AccountRowTest, new ClickOptions(){ClickType = NClickType.Double}.WithVariable("account_number_system1", "407547"));.
mouseButton NMouseButton
The mouse button to click with: Left, Middle, or Right. The default option is Left.

Click(IElementDescriptor, NClickType, NMouseButton)

Clicks a UI element identified by a descriptor of an element from Object Repository, specifying the click type and mouse button.

Click(
    IElementDescriptor elementDescriptor,
    NClickType clickType, 
    NMouseButton mouseButton)Click(
    IElementDescriptor elementDescriptor,
    NClickType clickType, 
    NMouseButton mouseButton)
elementDescriptor IElementDescriptor
The UI element you want to click, identified by a descriptor of an element from Object Repository.
clickType NClickType
The type of click to perform: Single, Double, Down, or Up. The default option is Single.
For example, to perform a double click you just need to set the click type to NClickType.Double:clientAccountsScreen.Click(Descriptors.ACME_System_3.ClientAccountsScreen.AccountRowTest, new ClickOptions(){ClickType = NClickType.Double}.WithVariable("account_number_system1", "407547"));.
mouseButton NMouseButton
The mouse button to click with: Left, Middle, or Right. The default option is Left.

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.