Activities
latest
false
Banner background image
UI Automation Activities
Last updated Apr 26, 2024

UI Automation 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.
APIDescription
AttachFocuses on a desktop application or web browser page that's already open, to use in UI Automation.
CheckSelects or clears a check box or a radio button.
ClickClicks a specified UI element, for example a button or a link. You can further configure the click action, according to your use case.
DragAndDropExecutes a drag and drop operation from the source UI element to the destination UI element.
ExtractDataExtracts data as data table.
GetAttributeRetrieves the value of a specified attribute of the indicated UI element.
GetChildrenRetrieves the children of a specified target.
GetRuntimeTargetRetrieves the runtime target of a specified target.
GetTextExtracts and copies the text from a UI element.
GetUrlRetrieves the URL from the current web page.
GoToUrlNavigates to the specified URL in the indicated web browser.
HighlightVisually highlights a specified UI element by surrounding it in a box.
HoverRetrieves the URL from the current web page.
IsEnabledChecks if an UI element is enabled.
KeyboardShortcutSends one or more keyboard shortcuts to a UI element.
MouseScrollEnables scrolling in applications by sending mouse scroll events to the specified UI element.
OpenOpens a desktop application or web browser page to use in UI automation.
SelectItemSelects an item from a drop-down combo box or list box.
TakeScreenshotTakes a screenshot of a specified UI element or application and saves it to a file.
TypeIntoEnters 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.
WaitStateChecks 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

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.