Object repo sees menu item as different xpath than menu

Ranorex Spy, Recorder, and Studio.
Posts: 104
Joined: Fri Nov 08, 2019 3:23 pm

Object repo sees menu item as different xpath than menu

Post by dmconsulting1 » Wed Jan 08, 2020 6:32 pm

Ranorex sees the File drop down menu here:

And sees the Restore option here:
/contextmenu[@processname='DrillApp']/menuitem[@accessiblename='Restore Recipe']

It works, but I end up with 2 applications in my Repo. One is my application under test, the other is the app related to the context menu.

Because it is an item in the File menu, it isn't something easy to Spy on its own. Is there a way to get Ranorex to see the context menu is part of the file menu that is part of the AUT?

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

Re: Object repo sees menu item as different xpath than menu

Post by odklizec » Thu Jan 09, 2020 8:10 am


Please post a Ranorex snapshot, where we can evaluate both xpaths (two snapshots may be required?).

Generally speaking, I see nothing wrong with two repo elements, because one points to 'form' and the other one to 'context menu', which are two different UI entities? What exactly is your problem, except "aesthetic" problem, that there are two root folders in repo? ;)

There is a way to merge both repo element into one, but I don't think that this is a very good idea, because it may have some unvated side effects, like identifying wrong or non-unique menu items.

What you can do, is to create a root folder with xpath like this:

Code: Select all

Then you can move both menu items into this newly created root folder, where each menu item should have xpath like this:

Code: Select all

//menuitem[@accessiblename='Restore Recipe']
Hope this helps?
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