Activities
latest
false
APIs - Other latest
logo
UI Automation Activities
Last updated Nov 28, 2023

APIs

APIs allow you to access and interact with the services offered in the Manage Packages menu. You can use these APIs when you design coded automations. Visit Coded Automations to learn about coded automations and how to design them using APIs.
Note: Using Go to Definition (F12) allows you to access the definition of UiPath APIs for a certain service. We recommend relying only on the directly exposed APIs when you implement coded automations. Other APIs that are not directly exposed with a service are subject to change without prior notification.

Overloads

APIs often have overloads, which means they provide multiple versions of the same method with different parameter options. Overloads allow you to customize the behavior of the API based on your specific requirements. For example, a UI Automation API may have an overload that accepts a timeout parameter to specify the maximum time to wait for a UI element to appear before ending execution.

By using the APIs with their respective overloads, you can easily achieve your desired automation logic and behavior.

UI Automation APIs

This section includes the APIs found in the UiPath.UIAutomationNext.API.Contracts service.
API Description
Attach Focuses on a desktop application or web browser page that's already open, to use in UI Automation.
Check Selects or clears a check box or a radio button.
Click Clicks a specified UI element, for example a button or a link. You can further configure the click action, according to your use case.
DragAndDrop Executes a drag and drop operation from the source UI element to the destination UI element.
ExtractData Extracts data as data table.
GetAttribute Retrieves the value of a specified attribute of the indicated UI element.
GetChildren Retrieves the children of a specified target.
GetRuntimeTarget Retrieves the runtime target of a specified target.
GetText Extracts and copies the text from a UI element.
GetUrl Retrieves the URL from the current web page.
GoToUrl Navigates to the specified URL in the indicated web browser.
Highlight Visually highlights a specified UI element by surrounding it in a box.
Hover Retrieves the URL from the current web page.
IsEnabled Checks if an UI element is enabled.
KeyboardShortcut Sends one or more keyboard shortcuts to a UI element.
MouseScroll Enables scrolling in applications by sending mouse scroll events to the specified UI element.
Open Opens a desktop application or web browser page to use in UI automation.
SelectItem Selects an item from a drop-down combo box or list box.
TakeScreenshot Takes a screenshot of a specified UI element or application and saves it to a file.
TypeInto Enters text in a specified UI element, for example a text box. You can also send special keys like Tab or Enter to the UI element.
WaitState Checks the state of an application or web browser by verifying if an element appears in or disappears from the user interface.

Using UI Automation APIs

You can use UI Automation APIs in combination with UI elements. The process of automating UI applications involves opening the desire application or focusing on it, then automating its UI elements. Perform the following steps to automate an application using UI Automation APIs:

  1. Call the UI Automation service, when you use the Attach and Open APIs. These APIs are used on their own, to open or focus on an application or web browser.
    1. When working with UI elements captured in the Object Repository as descriptors, employ the Open or Attach API with the IScreenDescriptor overload:

      uiAutomation.Open(ObjectRepository.Decriptors.<ApplicationName>.<ScreenName>)

    2. For native selectors, copy the <app/> tag of the application using the UI Explorer and utilize the Open API with the TargetAppModel overload:

      var applicationScreen = uiAutomation.Open(Target.FromSelector("<html app = 'chrome.exe'/>"))

  2. Call the UI Automation APIs directly on a UI element.
    1. When working with UI elements captured in the Object Repository as descriptors, employ the rest of the APIs with the IElementDescriptor overload:
      var applicationScreen = uiAutomation.Open(ObjectRepository.Decriptors.<ApplicationName>.<ScreenName>)
      applicationScreen.TypeInto(ObjectRepository.Descriptors.<ApplicationName>.<ScreenName>.<ElementName>, "Hello")var applicationScreen = uiAutomation.Open(ObjectRepository.Decriptors.<ApplicationName>.<ScreenName>)
      applicationScreen.TypeInto(ObjectRepository.Descriptors.<ApplicationName>.<ScreenName>.<ElementName>, "Hello")
    2. For native selectors copy the <webctrl/> tag of the element using the UI Explorer, and employ the rest of the APIs with the TargetAnchorableModel overloads:
      var applicationScreen = uiAutomation.Open(Target.FromSelector("<html app = 'chrome.exe'/>"));
      applicationScreen.TypeInto(Target.FromSelector("<webctrl id='generalClick' tag='BUTTON'/>"), "Hello")var applicationScreen = uiAutomation.Open(Target.FromSelector("<html app = 'chrome.exe'/>"));
      applicationScreen.TypeInto(Target.FromSelector("<webctrl id='generalClick' tag='BUTTON'/>"), "Hello")
  • Overloads
  • UI Automation APIs
  • Using UI Automation APIs
logo
Get The Help You Need
logo
Learning RPA - Automation Courses
logo
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2023 UiPath. All rights reserved.