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