Understanding Selectors in UiPath RPA

Selectors in UiPath

Selectors of all GUI interacting activities in UiPath can be edited similarly as per user requirements. The most frequent requirement is adding * to selectors to make it dynamic or to remove unreliable selectors altogether.

The image shows a Click activity with its pointers on the See phone button. To edit the selectors further, the user can click on the 3 horizontal bars and select Edit Selector. This will bring up the Selector Editor window. The user can also edit the selector inside the UiExplorer by opting for Open in UiExplorer.

  • By default, UiPath has captured title, app, and id. The app selector is always required but the rest of them are highly unreliable.
  • This is because the title is dependent on the information of the current and will change for a new search. And similarly, id is dependent on the name of the service provider and will stop working for a new search or even on the next page.

  • If we open a new search that is https://empresas.habitissimo.com.br/construcao-casas, the click activity stops working altogether.
  • We can use Indicate Element again to point to the See Phone button but it will stop working again for a new search.

  • To make the click dynamic and click the See Phone of the first result for every unique search, we need to make the selector dynamic with the help of * wildcard.
  • But before that, we require to identify the part of each selector that does not change. To do so, simply use Indicate Element and select the new See phone.

  • We can see that the title has habitissimo common with the previous one. Also, id has show_phone common with the previous selector. The later part of these selectors is changing and hence that is where we will use the * as shown in the above image.

The validate button is Green and clicking on Highlight, correctly points to the first See phone button. Clicking on Ok finalizes this selector setting for the activity.