RxPath for Windows Desktop Icons

Ask general questions here.
loonquawl2
Posts: 1
Joined: Tue Mar 03, 2020 12:05 pm

RxPath for Windows Desktop Icons

Post by loonquawl2 » Tue Mar 03, 2020 12:52 pm

Hi!
I tried to find Icons on the Windows Desktop using Spy, and it returned a path that began with \dektop - this worked for a while, until it suddenly did not. For a while the icons where findable only on a path that was the same, but began with \form (byline: \form and \dom had been the only rxpath roles i had known before encountering \desktop - is there a list of all posible roles?) - so i changed the root folder accordingly, and it worked again, for a while...

Just skipping the root folder makes the search take a long time (search with root-role (form or desktop, whatever works at the time): 50ms -- Search without root-role: 3,5 seconds...)

Is there a possibility of offering two alternative xpaths, or something?

/desktop[@processname='explorer']/?/?/list[@controlid='1']/listitem[@text='Pass.png'] Fast, if it works

/form[@processname='explorer']/?/?/list[@controlid='1']/listitem[@text='Pass.png'] Fast, if it works

//?/?/list[@controlid='1']/listitem[@text='Pass.png'] Reliably works, but takes whole seconds

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6036
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: RxPath for Windows Desktop Icons

Post by odklizec » Tue Mar 03, 2020 6:12 pm

Hi,

This should do the trick...
/*[@processname='explorer']/?/?/list[@controlid='1']/listitem[@text='Pass.png']
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration