studio
2023.4
false
UiPath logo, featuring letters U and I in white
Studio User Guide
Last updated Nov 4, 2024

About Selectors

To automate specific actions in the user interface, you are required to interact with various windows, buttons, drop-down lists and many others. One of the ways in which UI elements can be identified is by using their position on the screen, but this can be unreliable.

To overcome this problem, Studio uses what we call selectors. These store the attributes of a graphical user interface element and its parents, in the shape of an XML fragment.

Most of the times, selectors are automatically generated by Studio and do not require further input from you, especially if the apps you are trying to automate have a static user interface.

However, some software programs have changing layouts and attribute nodes with volatile values, such as some web-apps. Studio cannot predict these changes and, therefore, you might have to manually generate some selectors.

A selector has the following structure:

<node_1/><node_2/>...<node_N/><node_1/><node_2/>...<node_N/>

The last node represents the GUI element that interests you, and all the previous ones represent the parents of that element. <node_1> is usually referred to as a root node, and represents the top window of the app.

Each node has one or more attributes that help you correctly identify a specific level of the selected application.

Each node has the following format: 

<ui_system attr_name_1='attr_value_1' ... attr_name_N='attr_value_N'/><ui_system attr_name_1='attr_value_1' ... attr_name_N='attr_value_N'/>

Every attribute has an assigned value. It is important to pick attributes with a constant value. If the value of an attribute changes each time the app is started, then the selector will not be able to correctly identify the element.

Selectors are displayed in the Properties panel of activities, under Input > Target > Selector. All activities related to graphical elements have this property.



The Selection Options window enables you to select and edit a target. To access this window, in the Workflow Designer panel, click the Options button in the body of an activity and select Indicate target on screen or Edit target.



The Selector Editor window enables you to see the automatically-generated selector and edit it and its attributes. To access this window, use the Ellipsis button next to the Selector field, in the Properties panel.



Option

Description

Validate

The button shows the status of the selector by checking the validity of the selector definition and the visibility of the target element on the screen.

The Validate button has three states:

  • docs image Selector is being validated
  • docs image Valid selector
  • docs image Invalid selector
  • docs image Modified selector, revalidate

The button is correlated with UI Explorer validation states.

Indicate Element

Indicate a new UI element to replace the previous one.

Repair

Enables you to re-indicate the same target UI element and repair the selector. This operation does not completely replace the previous selector. The button is available only when the selector is invalid.

Highlight

Brings the target element in the foreground. The highlight stays on until the option is disabled with a click. The button is enabled only if the selector is valid.

Edit Attributes

Contains all the application components needed to identify the target application (a window, a button etc.). This section is editable.

Edit Selector

Holds the actual selector. This section is editable.

Open in UI Explorer

Launches the UI Explorer. The option is enabled only for valid selectors.

Note: In some situations, when Studio and the targeted application are opened with different elevated privileges, the selector might not work. We recommend to always open both applications with the same privileges.

Supported Tags and Attributes

The following tables present the compatibility between tags and attributes used to build selectors and the selector capability:

Note: Selectors generated for Java applications which contain multiple WND tags cannot be used with events monitoring.

WND

Attribute

Fuzzy

RegEx

Case-Sensitive

app

available

available

available

cls

available

available

available

title

available

available

available

aaname

available

available

available

ctrlname (WinForms)

available

available

available

ctrlid (WinForms)

available

available

available

idx

not available

not available

not available

tid

not available

not available

not available

pid

not available

not available

not available

isremoteapp

not available

not available

not available

aastate

available

available

available

sapClient (SAP)

available

available

available

sapLanguage (SAP)

available

available

available

sapProgram (SAP)

available

available

available

sapScreen (SAP)

not available

not available

not available

sapSession (SAP)

not available

not available

not available

sapSysName (SAP)

available

available

available

sapSysNumber (SAP)

not available

not available

not available

sapSysSessionId (SAP)

available

available

available

sapTransaction (SAP)

available

available

available

sapUser (SAP)

available

available

available

HTML

Attribute

Fuzzy

RegEx

Case-Sensitive

url

available

available

available

htmlwindowname

available

available

available

title

available

available

available

class

available

available

available

app

not available

not available

not available

idx

not available

not available

not available

pid

not available

not available

not available

tid

not available

not available

not available

excludehwnd

not available

not available

not available

bsid (Browser Session ID)

not available

not available

not available

isremoteapp

not available

not available

not available

WEBCTRL

The tag and idx attributes use string values. All other WEBCTRL attributes have dynamic values.

Attribute

Fuzzy

RegEx

Case-Sensitive

tag

available

available

available

idx

available

available

available

aaname

available

available

available

name

available

available

available

id

available

available

available

parentid

available

available

available

class

available

available

available

css-selector

not available

not available

not available

innertext

available

available

available

visibleinnertext

available

available

available

isleaf

available

available

available

parentclass

available

available

available

parentname

available

available

available

src

available

available

available

href

available

available

available

tableCol

available

available

available

tableRow

available

available

available

colName

available

available

available

rowName

available

available

available

aria-label

available

available

available

aria-labelledby

available

available

available

CTRL

Attribute

Fuzzy

RegEx

Case-Sensitive

role

available

available

available

name

available

available

available

automationid

available

available

available

labeledby

available

available

available

aastate

available

available

available

virtualname

available

available

available

text

available

available

available

rowName

available

available

available

idx

not available

not available

not available

UIA

Attribute

Fuzzy

RegEx

Case-Sensitive

accelkey (Accelerator Key)

available

available

available

acskey (Access Key)

available

available

available

automationid

available

available

available

cls

available

available

available

helpText

available

available

available

legacyAccHelp (Legacy Accessible Help)

available

available

available

enabled

available

available

available

kbfocus (Is Keyboard Focusable)

available

available

available

ispwd (Is Password)

available

available

available

itemstatus

available

available

available

itemtype

available

available

available

rtid (Runtime ID)

available

available

available

role

available

available

available

name

available

available

available

pid

available

available

available

tableRow

not available

not available

not available

tableCol

not available

not available

not available

rowName

available

available

available

colName

available

available

available

idx

not available

not available

not available

JAVA

Attribute

Fuzzy

RegEx

Case-Sensitive

role

available

available

available

name

available

available

available

virtualname

available

available

available

javastate

available

available

available

tableRow

not available

not available

not available

tableCol

not available

not available

not available

rowName

available

available

available

colName

available

available

available

idx

not available

not available

not available

SAP

Attribute

Fuzzy

RegEx

Case-Sensitive

id

available

available

available

leafid

This attribute is not exposed in the Attribute panel because it is mutual-exclusive with the id attribute. It can be added manually.

available

available

available

tableRow

not available

not available

not available

tableCol

not available

not available

not available

colName

available

available

available

relpath

available

available

available

itemId

available

available

available

SILVERLIGHT

Please note that the Silverlight tag does not support Fuzzy, RegEx, and Case-Sensitive capabilities.

  • Supported Tags and Attributes
  • WND
  • HTML
  • WEBCTRL
  • CTRL
  • UIA
  • JAVA
  • SAP
  • SILVERLIGHT

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.