Is it best practice to store selectors in string variable in config file in Json or excel format?

Hi @loginerror

I want to know whether we can save all the selectors used in project in a string variable in a configuration file in json or excel file. Could you please let us know whether it is the best practice followed in uipath?

Thanks,
Ulaga

1 Like

@Boopathi

According to my understanding storing all the selectors in config file is not a best practice and UiPath also doesn’t suggest that.

When all the selectors are stored in config file, there is effort included to fetch the details from config and assign it to the activities. meanwhile you should also check whether the selector entry exists in config for all the entries.

However, if your application has elements with varying selectors, you can still save the limited number of selectors(that vary always) in the config. But thus the statement of the automation will change as you need to update it every time. The best solution is to fine tune the selectors.

Hope this is helpful!

1 Like

Hi @Boopathi

Well in terms of best practices no it is not been mentioned but it does not mean that we cannot have it. But before we do I would like to understand the why do you wanna do that.

  1. Is it because you are expecting multiple changes in your application? If Yes, In that case your process is not a good candidate of RPA. If No, Then what’s the point of adding complexity to your process.

  2. Are your selectors dynamic or they depend on external factors? If Yes, I believe you should make those external factors configurable and use variable to make your selectors dynamic. And If these values change very often then they should be kept in Orchestrator Assets instead of Config file to prevent multiple package deployments.

In case if you have any other reason for making selectors configurable please let us know.

Thanks

2 Likes

Hi @Saahil_Chauhan

Thank you for your suggestion. If we keep all the selectors in a string variable then no need to open that particular element in the UI code to recapture it. I just recapture separately and add that selector in that config file so asked whether it is best pracs to add selectors in config file. Also, please let me know if there is any separate link to know about best practices in uipath before move to production.

Thanks,
Ulaga