Selector Not Found Exception on Context Menu control in Desktop App

I am receiving the Selector Not Found Exception when running a UI Path solution to populate a legacy accounting system that we otherwise have no API for.

In the Studio, I used Desktop Recording to accomplish my immediate goals, however, this exeption raises itself upon the second (or any subsequent) iteration of the RPA process.

If I close out the accounting application and restart it, then the process works are far as I have it configured, but if I do not close it out and simply restart the UI process then this Exception is raised. It is always raised on the same control, which is a context menu, screen shot below:
image

Thanks in advance if have any suggestions.

Jim,

Perhaps something in your selector is specific enough that it does not work on the second iteration?

You can try using “Attach to live element” on the selector that failed. UiPath will automatically update the selector to something less specific using wildcards. Alternatively you can try to insert wildcards in the selector yourself. Good information on the use of wildcards can be found here: https://studio.uipath.com/v2017.1/docs/selectors-with-wildcards

Folks here may be able to help if you share a screen shot of your selector in UI Explorer. A screenshot of the error in your sequence could also help.

Martin,
Thanks for the reply. I will try your suggestion now and advise.

FYI, The selector is here:

<ctrl name='Context' role='popup menu' />
<ctrl automationid='258' />

And the error message (with expanded details) here:

image

And I couldn’t seem to attach to live element so I will try the wildcards and investigate further:

image

Hi Jim,

I would look specifically at <ctrl automationid=‘258’ />

Try using Ui Explorer upon failure to select the target element and see what shows up as the selector. My hunch is <ctrl automationid=‘258’ /> will be a different value.

2 Likes

Hi.
use hotkey then.

Martin, thanks again for replying. Your hunch was correct. The automation id becomes 264 on the second iteration. I will not have the time to revisit this until the latter half of my day here, but will try to figure something out short of restarting the application with each transaction we need to post.

I really appreciate your feedback.

Jim,

You might be able to get away with inserting an asterisk (*) as the ID value for your selectors that are failing. UiPath will treat the asterisk as a wildcard. With any luck this will solve your problem.

So in your selector change
<ctrl automationid=‘258’ />
to
<ctrl automationid=‘*’ />
And see what happens