Hello @Anonymous .
From the experience you are describing, I infer that the selector for the specific UI element is dynamic and it is changing with every relaunch of the application.
In order to handle this, you have to create a new more robust UI selector, that will be able to locate the element even if the underlying structure of the element is dynamic. Any parts of the selector that are dynamic, should be removed. To achieve that, capture again the element after the failure, and compare the new selector with the old one to identify the differences like @aminab-msft indicated (copy/paste the new one and the old one into a notepad and then compare them). Please try to perform the comparison with the default selectors, as have been captured by Power Automate Desktop, before any editing.
After identifying the dynamic part of the selector, edit it to make sure that it contains only static elements/attributes that are not going to change. Also, you might have to use the operators into the Selector builder, as 'Starts with', 'Contains', etc. or regular expressions in order to specify the value of a selector and support dynamic values.
For example, the below captured UI element selectors indicate that the UI element has dynamic selector:
- > custom[Class="ObjectEditor"] > custom[Id="AccountEditor"] > tab[Class="TabControl"] > tabitem[Name="Account Detail"] > text[Id="tbAccountId192"]
- > custom[Class="ObjectEditor"] > custom[Id="AccountEditor"] > tab[Class="TabControl"] > tabitem[Name="Account Detail"] > text[Id="tbAccountId182"]
As you may notice, we have to support dynamic values for the leaf level attribute. Therefore, we have to change the 'Equal to' operator to 'Starts with' and delete the postfix number that is different in the two selectors:

And the new selector:
- > custom[Class="ObjectEditor"] > custom[Id="AccountEditor"] > tab[Class="TabControl"] > tabitem[Name="Account Detail"] > text[Id^="tbAccountId"]
Also, in some cases you might have to use variables in the selectors. The values of these variables should be set into the desktop flow before the selector is used.
Example:
- Set variable %ID_var% in desktop flow.
- Use it in the selector as:
- > custom[Class="ObjectEditor"] > custom[Id="AccountEditor"] > tab[Class="TabControl"] > tabitem[Name="Account Detail"] > text[Id="tbAccountId%ID_var%"]
Moreover, although using the ID attribute is usually the best way to proceed, you have to ensure that the selector identifies one and only one element in the window. If all 'Connect' buttons in the window have the same value for the ID attribute, then you have to insert additional attributes in order to make the selector unique.
I hope the above helps.