Selector issue in a desktop application

selector
uiautomation

#1

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.


#2

Hi @Reshma,

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


#3

Hi @Reshma,

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

If possible attach the selector window screenshot.


#4

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


#5

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’/”


Selector not working
#6

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.


#7

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


#8

Hi,

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.

Regards,
Amrita


#9

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.

Thanks.

Best regards
Anders


#10

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.
Thanks.

Best regards
Antonio