Subscribe

UiPath Studio

The UiPath Studio Guide

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, UiPath 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. UiPath 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/>

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'/>

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 stored in the Properties panel of activities, under Input > Target > Selector. All activities related to graphical elements have this property.

580

The Selector Editor window enables you to see the automatically-generated selector and edit it and its attributes. To access this window, in the Workflow Designer panel, click the Options Options button button in the body of an activity and select Edit Selector.

1202

This can also be done by using the Ellipsis image alt text button next to the Selector field, in the Properties panel.

609
OptionDescription
ValidateThe 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:
image alt text Selector is being validated
image alt text Valid selector
image alt text Invalid selector
image alt text Modified selector, revalidate

The button is correlated with UI Explorer validation states.
Indicate ElementIndicate a new UI element to replace the previous one.
RepairEnables 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.
HighlightBrings 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 AttributesContains all the application components needed to identify the target application (a window, a button etc.). This section is editable.
Edit SelectorHolds the actual selector. This section is editable.
Open in UI ExplorerLaunches 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

AttributeFuzzyRegExCase-Sensitive
appcheck_markcheck_markcheck_mark
clscheck_markcheck_markcheck_mark
titlecheck_markcheck_markcheck_mark
aanamecheck_markcheck_markcheck_mark
ctrlname (WinForms)check_markcheck_markcheck_mark
ctrlid (WinForms)check_markcheck_markcheck_mark
idxno_rightno_rightno_right
tidno_rightno_rightno_right
pidno_rightno_rightno_right
isremoteappno_rightno_rightno_right
aastatecheck_markcheck_markcheck_mark
sapClient (SAP)check_markcheck_markcheck_mark
sapLanguage (SAP)check_markcheck_markcheck_mark
sapProgram (SAP)check_markcheck_markcheck_mark
sapScreen (SAP)no_rightno_rightno_right
sapSession (SAP)no_rightno_rightno_right
sapSysName (SAP)check_markcheck_markcheck_mark
sapSysNumber (SAP)no_rightno_rightno_right
sapSysSessionId (SAP)check_markcheck_markcheck_mark
sapTransaction (SAP)check_markcheck_markcheck_mark
sapUser (SAP)check_markcheck_markcheck_mark

HTML

AttributeFuzzyRegExCase-Sensitive
urlcheck_markcheck_markcheck_mark
htmlwindownamecheck_markcheck_markcheck_mark
titlecheck_markcheck_markcheck_mark
classcheck_markcheck_markcheck_mark
appno_rightno_rightno_right
idxno_rightno_rightno_right
pidno_rightno_rightno_right
tidno_rightno_rightno_right
excludehwndno_rightno_rightno_right
bsid (Browser Session ID)no_rightno_rightno_right
isremoteappno_rightno_rightno_right

WEBCTRL

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

AttributeFuzzyRegExCase-Sensitive
tagno_rightno_rightno_right
idxcheck_markcheck_markcheck_mark
aanamecheck_markcheck_markcheck_mark
namecheck_markcheck_markcheck_mark
idcheck_markcheck_markcheck_mark
parentidcheck_markcheck_markcheck_mark
classcheck_markcheck_markcheck_mark
css-selectorno_rightno_rightno_right
innertextcheck_markcheck_markcheck_mark
visibleinnertextcheck_markcheck_markcheck_mark
isleafcheck_markcheck_markcheck_mark
parentclasscheck_markcheck_markcheck_mark
parentnamecheck_markcheck_markcheck_mark
srccheck_markcheck_markcheck_mark
hrefcheck_markcheck_markcheck_mark
tableColcheck_markcheck_markcheck_mark
tableRowcheck_markcheck_markcheck_mark
colNamecheck_markcheck_markcheck_mark
rowNamecheck_markcheck_markcheck_mark
aria-labelcheck_markcheck_markcheck_mark
aria-labelledbycheck_markcheck_markcheck_mark

CTRL

AttributeFuzzyRegExCase-Sensitive
rolecheck_markcheck_markcheck_mark
namecheck_markcheck_markcheck_mark
automationidcheck_markcheck_markcheck_mark
labeledbycheck_markcheck_markcheck_mark
aastatecheck_markcheck_markcheck_mark
virtualnamecheck_markcheck_markcheck_mark
textcheck_markcheck_markcheck_mark
rowNamecheck_markcheck_markcheck_mark
idxno_rightno_rightno_right

UIA

AttributeFuzzyRegExCase-Sensitive
accelkey (Accelerator Key)check_markcheck_markcheck_mark
acskey (Access Key)check_markcheck_markcheck_mark
automationidcheck_markcheck_markcheck_mark
clscheck_markcheck_markcheck_mark
helpTextcheck_markcheck_markcheck_mark
legacyAccHelp (Legacy Accessible Help)check_markcheck_markcheck_mark
enabledcheck_markcheck_markcheck_mark
kbfocus (Is Keyboard Focusable)check_markcheck_markcheck_mark
ispwd (Is Password)check_markcheck_markcheck_mark
itemstatuscheck_markcheck_markcheck_mark
itemtypecheck_markcheck_markcheck_mark
rtid (Runtime ID)check_markcheck_markcheck_mark
rolecheck_markcheck_markcheck_mark
namecheck_markcheck_markcheck_mark
pidcheck_markcheck_markcheck_mark
tableRowno_rightno_rightno_right
tableColno_rightno_rightno_right
rowNamecheck_markcheck_markcheck_mark
colNamecheck_markcheck_markcheck_mark
idxno_rightno_rightno_right

JAVA

AttributeFuzzyRegExCase-Sensitive
rolecheck_markcheck_markcheck_mark
namecheck_markcheck_markcheck_mark
virtualnamecheck_markcheck_markcheck_mark
javastatecheck_markcheck_markcheck_mark
tableRowno_rightno_rightno_right
tableColno_rightno_rightno_right
rowNamecheck_markcheck_markcheck_mark
colNamecheck_markcheck_markcheck_mark
idxno_rightno_rightno_right

SAP

AttributeFuzzyRegExCase-Sensitive
idcheck_markcheck_markcheck_mark
leafid
This attribute is not exposed in the Attribute panel because it is mutual-exclusive with the id attribute. It can be added manually.
check_markcheck_markcheck_mark
tableRowno_rightno_rightno_right
tableColno_rightno_rightno_right
colNamecheck_markcheck_markcheck_mark
relpathcheck_markcheck_markcheck_mark
itemIdcheck_markcheck_markcheck_mark

SILVERLIGHT

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

Updated 3 months ago


About Selectors


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.