Problem with multiple Xpaths for Qt-Application

Ranorex Spy, Recorder, and Studio.
CuTe
Posts: 1
Joined: Mon Feb 21, 2011 11:50 am

Problem with multiple Xpaths for Qt-Application

Post by CuTe » Mon Feb 21, 2011 12:38 pm

Hello,

i am evaluating Ranorex for automated tests of Qt-application under Windows XP.
The accessibilty plugin works fine, but every control (buttons, ipnut fields, ...) is recognized under multiple paths.
So i can see, at least, 4 different paths to the same control. I tried to create one repository with the shortest path of all controls. When i use the recorder, it creates its own elements with long paths. Looks like its using 'depth first search' in the object tree (as it appears in the spy), and returns the first found path to the element, which is not the shortest. So i have to replace all the paths by hand, and this takes hours and therefore is not suitable for us.
Is it possible to let the recorder search for the shortest path (like 'breadth first search') of the element in the objecttree, or to force the recorder to use the paths that are already defined in the repository?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Problem with multiple Xpaths for Qt-Application

Post by Support Team » Mon Feb 21, 2011 8:13 pm

CuTe wrote:The accessibilty plugin works fine, but every control (buttons, ipnut fields, ...) is recognized under multiple paths.
Could you please explain that a little more in detail? E.g. could you post the repository? What Ranorex version do you use?

RanoreXPath always performs a breadth-first search. However, when you track an item, Ranorex performs a FindFromPoint operation which tries to get the best (=smallest) element at that point and then creates the RanoreXPath for it. Maybe this is what you experience?

In general, the Ranorex repository tries to use the items that are already in the repository. However, if the paths are not very similar, e.g. if the have a different number of levels in it or use special operators like "//", Ranorex cannot automatically determine that two paths match. Then the repository generator uses the "safe" alternative and creates a new repository item.

Regards,
Alex
Ranorex Team
.
Image