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

UI Automation Modern

UI Automation Modern uses a combination of technologies for identifying and locating UI elements: full selector, fuzzy selector, and image, all wrapped in an anchor-based algorithm.

Important: Starting with v2020.10, the UI Automation Next package has been deprecated and the existing UI Automation package has been expanded to include all the modern features previously available in UI AutomationNext. You are also able to install the unified UI Automation activity package even on Studio versions 2020.4.1 and lower. This displays all the classic and modern activities in the activities pane. Read more about the Modern Design Experience.

UI Automation Modern contains activities that help you automate the most common UI interactions. The first step in automating UI interactions is to define the desktop application or web page to interact with by adding a Use Application/Browser activity. You then add the activities to automate in that application or web page inside the Use Application/Browser activity.

To speed up the process, you can use the App/Web Recorder that automatically generates activities by capturing your actions on the screen.

Note: The Extract Table Data activity and App/Web Recorder are not compatible with Studio versions 2019.10.4 and earlier.

Web Browser Support

The UI Automation Next package supports the following web browsers:

  • Internet Explorer 8.0 or greater
  • Google Chrome version 64 or greater
  • Mozilla Firefox version 52.0 or greater
  • Microsoft Edge Chromium version 79 or greater on Windows 10 version 1803 or greater. Edge Legacy is not supported.

Targeting Methods

UI Automation Next uses a combination of the following methods to identify UI elements:

  • Selector - An XML fragment that stores the attributes of an element and its parent elements, including the target application.
  • Fuzzy Selector - A selector that takes into account possible changes in the attributes of an element, identifying them based on a pattern, rather than on an exact match. This method works best when used with anchors.

    You can find more information about selectors in the Studio guide.

  • Image - An image in the application window that identifies the element, for example an icon or a button.

About Targets and Anchors

A target is a UI element you want to interact with, for example a button to click, a text box to type into, or a part of a web page from which to copy text.

An anchor is another nearby element that helps to uniquely identify the target. When you indicate a target, UiPath tries to identify and automatically select an anchor. You can also manually add up to three anchors.

When to Use an Anchor

Anchors are useful when a target element is not unique. For example, a form in a desktop application typically contains multiple similar text boxes into which to enter various data. The way you identify what data needs to go into each one is by looking at the labels next to them. Similarly, when the label of a text box is added as its anchor, the Robot uses the anchor to identify the text box to type into.

In some scenarios, multiple anchors are required to distinguish a target from other similar elements called duplicates. For example, if a form contains billing address and shipping address sections, the text boxes in them appear twice with the same label, so you need to add both the labels (e.g. "Zip code") and the title of the section (e.g. "Billing address") as anchors to identify the correct one.

Indicating a Target

In most cases, all you have to do to define a target is point to it on your screen and click. The methods required to identify the target and any suitable anchor are detected and their properties are automatically generated.

To indicate a target:

  1. Click Indicate target on screen inside a UI Automation Next activity.

    The target selection mode is opened. As you start moving the mouse, all the recognized UI elements are highlighted. The Selection Options window appears on the screen with information about the target identification status and additional options.

  2. Place the mouse pointer on the desired element, make sure it is highlighted, and then click it.

    • If the target element is identified, it is highlighted in green.

      • If an anchor was also automatically selected, it is highlighted in blue.
      • If an anchor was not automatically selected, you can click a nearby element that helps identify the target (for example, a label or a title) to add it as an anchor.
      • To add an additional anchor, hover the target element, select Add Anchordocs image in the hover menu, and then click the element to add as anchor.
    • If the target was not identified because there are too many other similar elements on the screen, the element is highlighted in red and the similar elements are highlighted as duplicates in yellow. Click another element on the screen to add it as an anchor.

      • If the selection is valid, the target and anchor are highlighted in green and blue respectively.
      • If the target and anchor are highlighted in red, the selection is still invalid. Hover the element you indicated as target and click Add Anchordocs image in the hover menu to add a second anchor. Repeat this to add a third anchor if necessary.
    • To complete the target identification, click Confirm in the Selection Options window. You can also confirm by clicking in the target hover menu or by pressing Enter on your keyboard.

      The target is configured and the activity displays a screenshot of the target and any anchors that were added.



Additional options are available in the Selection Options window to help you indicate elements:

  • If an element is not visible on your screen or the application is not in the correct state, you can press F2 on your keyboard to pause element selection while you set the application to the correct state.

    This is useful for elements that require an additional action to appear on screen, or disappear easily from it. For example, if you want to indicate specific elements in drop-down or hover menus, you can pause selection while you click the drop-down or move the mouse pointer on the hover menu to activate them.

  • Switch to Image selection mode. Press F3 on your keyboard to change to image-based identification only, and then use your mouse to select a visible region from the application window to use as target or anchor.
  • Change the UI Framework. By default, a proprietary framework is used to access the target application window. If a target is not detected, try to change the framework by pressing F4 on your keyboard. Select AA (Active Accessibility) for older applications or UIA (Microsoft UI Automation) for newer applications. After you select a target, the option to change the UI Framework is no longer available.



Editing a Target

If the target is not identified correctly during project execution, you can edit the target and its anchors after you have indicated it by selecting > Edit Target in the body of the activity. This opens the selection mode with the target and any identified anchors highlighted. A menu is displayed when you hover the mouse over a target or anchor.



  • To remove a target or an anchor, hover it, and then click Deletedocs image in the hover menu. If you remove a target, the first element you click is added as the new target.
  • To add an anchor for a target, click the element to add as an anchor. Depending on the settings of your project, you may need to click Add Anchordocs image in the hover menu of the target first. You can add up to three anchors for each target.
  • To edit a target or an anchor, hover it, and then click Settings in the hover menu. The properties of the methods used for detecting the element can be edited from the Advanced Settings section of the Selection Options window:

    • Selector / Fuzzy Selector

      • Edit the selector using the corresponding text box. To copy the selector for pasting in another element or for editing in the UI Explorer, click Copy next to it.

        You can also use variables in attribute values. The variables must be surrounded in double curly brackets, for example <wnd name='da{{var1}}'/> adds the value of var1 to the selector. The default value of the variable is used at design time.
      • For Fuzzy Selectors, you can change the Selector Accuracy level by dragging the corresponding slider from 0.4 to 1. This measurement expresses the level of similarity between the attribute you are searching for and the one to be found. To find results with a higher similarity, increase the value. The default value is 0.7.
    • Image

      • Change the Image Accuracy level by dragging the corresponding slider from 0.4 to 1. This measurement expresses the level of similarity between the image you are searching for and the one to be found. In situations when the image to be found can be slightly different than the one you are searching for, you can lower the accuracy. The default value is 0.8.
    • Disable / enable a method by clearing / selecting the check box next to the method name.
    • Verify how unique a method is by clicking Show all matchesdocs image next to it. This checks all the elements in the window and highlights all that have similarities with the currently selected element in yellow.
    • Click Apply to save the changes, and then click Validate if you want to validate the selection. To save the selection, click Confirm.



Validating Your Selection

Validation enables you to check how effective the current selection is in identifying the target by checking it using all selected methods and anchors. The result of the validation is displayed at the top of the Selection Options window. If adjustments are needed, a message is displayed with information on how to improve the selection.

The performance of each method is displayed in the Advanced Settings section of the Selection Options window using one of the following icons:



The method was the first to successfully identify the element.

The method successfully identified the element.

The method failed to identify the element because too many duplicates were found.

The method failed to identify the element.

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.