Desktop Shortcuts Identification sometimes fails

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
melodican
Posts: 31
Joined: Fri Nov 04, 2016 12:50 pm

Desktop Shortcuts Identification sometimes fails

Post by melodican » Fri Aug 26, 2022 10:46 am

Very often we use desktop shortcuts to start the SUT from Ranorex. The repository item looks like this:
/desktop[@processname='explorer']/?/?/list[@controlid='1']/listitem[@text='myShortcut']

In 90% of the cases it works, but sometimes Ranorex does not find the shortcut on the same PC. Using Ranorex Spy we notice, that Ranorex is identfying the shortcut suddenly different as:
/form[@title='']/?/?/list[@controlid='1']/listitem[@text='myShortcut']

So the first part is different (/form[@title=''] instead of /desktop[@processname='explorer']). After restarting the PC it works again. The shortcut specified as /desktop[@processname='explorer']/?/?/list[@controlid='1']/listitem[@text='myShortcut'] is identified by Ranorex.

Does anyone has an idea, what is causing the problem?

Adpating the Xpath to
/?/?/?/list[@controlid='1']/listitem[@text='myShortcut']
helps, but it takes Ranorex a long time to find the shortcut, because now there are so many places for Ranorex to look for the shortcut.

IvanF
Posts: 83
Joined: Thu Aug 11, 2022 8:55 pm

Re: Desktop Shortcuts Identification sometimes fails

Post by IvanF » Mon Sep 26, 2022 3:48 pm

Hi, the root switch can happen due to the Ranorex Studio application not being started as administrator and having to use a different plugin to find the recorded element and path. So, sounds like in some instances your Studio launch process may be different.

For your point about the more robust wild card path taking longer, maybe you could consider opening the application using the "Run application" step rather than a desktop shortcut altogether.