Selector issue in a desktop application

Hi All,

I am trying to automate a Desktop application. When I try to capture the selectors, I could find only 3 attributes - aastate, idx and role for all the elements in the application.

The value of the attribute “idx” keeps on changing every time I test the code. If I remove the idx attribute from selector, I am getting “Cannot find UI Element” error. I could not go with full Image automation as it requires multiple validation. Please provide your inputs if you had faced similar type of this issue.

Hi @Reshma,

could you replace "idx" by “*” asterisk as the wildcard entry and give a try.

Hi @Reshma,

Try to avoid as idx in selectors. Using idx is not effective way.

If possible attach the selector window screenshot.

1 Like

Hi @ddpadil , I replaced idx with “*” but it is automatically changing as “0” and also throwing “Cannot find the UI element” error.

Hi @cthamizh,

I could not attach screenshot due to security issues.

The selector will look like
“wnd app=‘ttv40.exe’ cls=‘SWT_Window0’ title=‘XXXXXX’/”
“wnd cls=‘SWT_Window0’ idx=‘78’/”

In the second line of your selector, try to choose isleaf, Parent id or parent class name. When you try anyone of these attributes, you will find that ‘idx’ is disappeare. Use that selector, that’s the most reliable one. Try this, I hope this helps to you.

1 Like

Has anybody solved this?
I have the same issue with a SAP Find window.
When the SAP session is started, the Selector is

wnd app=‘saplogon.exe’ cls=‘#32770’ title=‘Find’

Here Attach Window followed by Activate and Type Into recognizes selector

wnd app=‘saplogon.exe’ cls=‘#32770’ idx=‘*’ title=‘Find’

When the user has searched a single time during the SAP Session with search results returned, the selector changes to

wnd app=‘saplogon.exe’ cls=‘#32770’ idx=‘2’ title=‘Find’

and Attach Window followed by Activate and Type Into will not recognize selector

wnd app=‘saplogon.exe’ cls=‘#32770’ idx=‘*’ title=‘Find’

in this case.

I don’t know how to overcome this in an easy way.
Any ideas would be appreciated.

Best regards


You could try to close the first find window in SAP and the next time you need to search, open a new one. In this case, the selector of the window would ideally not have the idx attribute.

Generally, if the selector generated by UiPath is not stable, open UiPath explorer and observe the attributes available for the element on the right hand side. If you can select any other attributes like aaname, parent id, Ctrl Id etc, you can add them to the selector and see if it eliminates the idx. You can also add extra nodes of the hierarchy of the element’s parent which could be unique.

Another way if you are not able to find a unique selector after the above methods, you can also use the Anchor base activity. Find a stable element relative to the element and use it.

Hope this helps.


1 Like

Hi Amrita

Thanks for the elaborate answer. That is much appreciated.

I think SAP saves the Find window options in an .ini file or otherwise in a buffer. I have to close down the SAP Session entirely in order to reset the idx-attribute in the Find window. And this is not feasible in our situation.

I have tried adding aaname, but this did not remove the idx, unfortunately.

I will look further into adding extra nodes or using the Anchor based activity as you suggest.


Best regards

Hi All,
I have the same issue and at the moment I solved it throw Image recognition.
A better solution would be an activity that returns the runtime generated selector after click on an image inside the Sap find window. A find image that returns the selector of the windows clicked. The same behavior of the UiExplorer, click on object and obtain the selector.

Best regards

I have the same issue, have you solved it?
I have also idx which is changing.
thanks in advance

Hi All,
Iam also facing the same issue.If anyone knows how to resolve it can you please help me. Its urgent.
Thanks in Advance

Hi, you can try using ClickImage activity - incase you want to invoke button click event on the element. Worked like charm for me, FYI ClickImage would be available under UiPath.Core.Activities

I have solved the issue by using Get Active Window before Attach Window activity.
I faced an issue that Robot clicks on a Desktop item. But the selector of “explorer.exe” window changes from time to time. Uipath sometimes adds idx variable. Read the output of Get Active Window as a Window variable. Write Window variable to Attach Window activity as an input.


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