How to make a selector dynamic enough for it to work on a website with 2 different languages?

Hi there,

I currently have a project that shows me this bug from time to time:

Cannot find the UI element corresponding to this selector

I fix the selectors each time, but apparently they’re not stable enough. I am looking for a good, stable solution.

The robot works on a website where the login page can be in 2 different languages. It always chooses a random language. This is what my selector looks like now:

I added a wildcard after Production because the language also changes the words after Production.
What part of the selector do I have to change to make it dynamic enough? I’ve looked at the docs but I can’t really figure it out. Thank you!

For some reason it didn’t show my selector. This is what the selector looks like now:

html app=‘msedge.exe’ title=‘Productie *’
webctrl id=‘username’ tag=‘INPUT’

@Acerdins
Welcome to the forum

We did it sucessfully by using regex selector

1 Like

Hi, thank you for your reply. I just tried this, but it doesn’t work. Can you spot the flaw in my selector?

html app=‘msedge.exe’ title=‘Production *’
webctrl id=‘username’ matches=‘^(User Name:|Usuario:)$’ tag=‘INPUT’

regex selector is used different. Have a look here at the docu
https://docs.uipath.com/studio/standalone/2023.4/user-guide/regex-search

If I were you I would put the selector in one language with a Try/Catch around it. Then in the Exception block define the selector in the other language.

This is what the pick/pick branch activities are for.

Use a pick activity, fill it with two pick branches.
In both you enter a find element activity. Each one to search for an object with one of the language selectors.

This is executed in parallel. The first and only option/branch chosen is the one that appears.
Now in the actions of each branch you create the activities to log in for that language.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.