Page 1 of 1

Object repo sees menu item as different xpath than menu

Posted: Wed Jan 08, 2020 6:32 pm
by dmconsulting1
Ranorex sees the File drop down menu here:
/form[@processname='DrillApp']/container[@controlname='toolStripContainer1']//menuitem[@accessiblename='File']

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?

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

Posted: Thu Jan 09, 2020 8:10 am
by odklizec
Hi,

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

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