Page 1 of 1

Desktop Shortcuts Identification sometimes fails

Posted: Fri Aug 26, 2022 10:46 am
by melodican
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.

Re: Desktop Shortcuts Identification sometimes fails

Posted: Mon Sep 26, 2022 3:48 pm
by IvanF
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.