Automating a legacy application- The selector title is different in DEV and Test regions. Unable to make the selector generic

We are working on a legacy application. The Uipath Studio version we are using is 2021.10.5 and the package Uipath.System.Activities version is 22.4.1 . We had to use Click and Type Into activities at one workflow. So we used modern click and modern Type Into activities under Use Application activity.
There is a small difference in the titles of the application in DEV and TEST regions. So we were supposed to make title in the selector generic by keeping * .
We are facing two issues here.
This is the TEST selector title - cls=‘FNWND*’ title=‘Application Name - [Application Sub Name]’
& This is DEV - cls=‘FNWND*’ title='Application Name - DEV Lan - [Application Sub Name] ’

  1. We captured the entire application selector for Use application activity where it takes the entire title in the selector. But we wanted 3/4th of it as it is common in TEST and DEV. So we added * at the end.
    But when we capture the particular selector in Click and Type into Activities which are under the same Use Application, it takes the entire title and after capturing it is not allowing to edit the selector to add * to it. We tried editing it on Ui explorer as well. It did not allow.

  2. As the titles of the selectors are different in DEV and TEST, we captured the selectors separately in DEV and TEST regions. The selector which we captured in DEV works fine in DEV and the selector which we captured in TEST working fine in TEST. But the issue is when we try to make the selectors generic by adding * at the relevant place in the title in selector, it is not working in bot TEST and DEV.
    Eg- We tried below ways to make it generic
    a) ‘Application Name*’
    b) ‘Application Name*[Application Sub Name]’
    C) ‘Application Name’ and few more ways. But it isnt working.

If you are using modern activities please also double check the selectors for the anchors (if apply).

Regarding making the selector generic, you can explore the usage of regex selectors. I’ll leave you a link below.

It will look like this:
<Ctrl cls=‘FNWND*’ title=‘(Application Name - [Application Sub Name]|Application Name - DEV Lan - [Application Sub])’ matching:title=‘regex’ />

Take care of the square brackets since you will be using regex, you will need to scale them by adding \ before them.

Hope that helps,