Controls and selectors overview
Applications that the user interacts with using a graphical user interface (GUI) have controls that are arranged in one or more application windows. These controls can be push buttons, radio buttons, checkboxes, text boxes, frames, labels, among others. Windows are also controls. Controls are also called elements or components.
Application controls have attributes or properties. The application developer can define some of these attributes while the application's technologies load other attributes. To automate GUI controls, you need to identify the controls with which your bot must interact. One possible way to do that is using selectors.
Selectors are the combination of one or more attributes of a control to identify it. IBM Robotic Process Automation commands that interact with controls in a GUI need selectors to identify which control is the target of the action. Selectors can uniquely identify the control or reference more than one control because the selector is not specific enough. Common selectors are the control ID, the control name, its path in the application's element tree, called XPath, its class, the window title, among others.
To create selectors, you need to identify the internal attributes of the application's controls. In web applications, the browser developer tool provides access to attributes of page controls. Windows applications have third-party tools that make these attributes available. In IBM RPA Studio, the recorder is the standard tool for analyzing application control attributes. The recorder also generates commands with the appropriate selectors according to your choice.
Window selectors
Window selectors identify windows in an application that has a GUI. IBM Robotic Process Automation uses window selectors to attach windows to the automation context to interact with the window's internal controls. The available selectors are:
Title
The window title. Usually visible in the application's title tab as a label. Commonly, windows have a title. IBM Robotic Process Automation allows the title to be considered as a string literal or a regular expression
pattern.
Identifier
The window's unique ID.
Class name
The name of the class that instantiates the window.
Process ID
The process identifier number generated by Microsoft Windows™ when you start the application.
Process name
The name of the process identified by Windows when the application was started.
Style
The style refers to whether the window is a child window of another window or a standard Windows dialog window.
Minimum height
The size in pixels of the minimum expected height for the window. Windows that have a height greater than the selected minimum are considered as possible candidates for the selection.
Minimum width
The size in pixels of the minimum width expected for the window. Windows that have a width greater than the selected minimum are considered as possible candidates for the selection.
Control selectors
The control selectors reference a window's internal controls. In IBM Robotic Process Automation, you can use the following selectors:
ID
The control's unique identifier. Some applications generate IDs dynamically, making their use unviable.
Name
The name of the control. Name is an attribute that is usually created by the application developer and cannot be a unique attribute to the control.
Inner text and control type
The combination of the inner text and control type attributes. Inner text is the text that a control displays, and the control type is the object that defines a control. In Web applications, the
control type is the HTML tag of the control, and the inner text is the text the innerText
attribute defines. In Windows applications, the control type is the instantiated object, such as Button
, and the inner text
is the text that the control displays.
XPath
XPath stands for XML Path Language. Applications are sets of hierarchical controls within a window. This set can be expressed as nodes in XML. In Web applications, this set is the DOM. In Windows and SAP applications,
this set is represented by the control type tree within the window. The XPath selector is the path through the control tree to the target control. XPath must be the selector to reference controls in Java applications.
Class and value
The combination of attributes: class, which is the class that instantiates the control, and value, which is the value that is stored by the control. This selector is only valid if the control stores values.
Name and value
The combination of attributes: name and value. This selector is only valid if the control stores values.
ID and name
The combination of attributes: ID and name.
Class name
The name of the class that instantiates the control.
Type and index
The control type and the index of its position among controls of equal type. The control type depends on which class was used for its instantiation; the index is the position, with 0 being the first control
among equal types.
Type and name
The combination of attributes: control type and name.
Vision
The mapped image that identifies the control. When Vision is used, the bot searches the screen for the image that is defined as the selector for interaction. Used in surface automation.
Instance
The control instance. Control instances are stored in Instance
variables by the Search Control (searchControl
) command.
You can reference these variables whenever you need to.
CSS
The CSS path to the control node. This selector is exclusive for web automations.
Link text
The hyperlink text for an anchor element. Corresponds to the href
attribute. Exclusive for web automations.