Selectors are used by UiPath Studio and UiPath Robot to locate elements of the user interface (UI). They are represented as XML strings that contain information about UI controls (e.g., wnd and webctrl) and theirs attributes (e.g., aaname and tag). Although selectors are usually hardcoded into the activities that make use of them, in certain situations it can be necessary to choose a selector during runtime. Examples of such cases include:
Projects that support multiple languages and that have certain selectors that depend on the system’s language settings.
Projects that go through execution environments having different selectors. This situation can happen when the development sandbox for an application has selectors that are different than the ones used for testing or for production.
To enable a more flexible management of selectors, one alternative is to store them in external files, which can be called selector repositories. These repositories can be, for example, Excel workbooks with metadata about selectors, such as language and environment.
The Selector Repository Reader can retrieve selectors from selector repositories, filter them according to the system’s characteristics (e.g., language and environment) and return only selectors that match these characteristics.