Page 1 of 1

Different XPath in different Windos Design

Posted: Wed Oct 28, 2015 5:18 pm
by A_C
Ranorex spy creates different Xpaths according to the windows design (Control Panel\All Control Panel Items\Personalization).
I use Windows 7.

Design: Windows Classic
Xpath: /form[@title='Warnung']/button[@controlname='Yes']

Example:
Design Windows 7 Basic:
Xpath: /form[@title='Warnung']/?/?/element[@instance='0']/button[@text='&Ja']

I created test automations on a pc with windows classic design and cannot run them on a pc with other designs.

Re: Different XPath in different Windos Design

Posted: Wed Oct 28, 2015 6:22 pm
by krstcs
Why would you expect them to be the same?

They are different windows, designed in different ways, with different technologies, and the layout (most importantly) is different.

RanoreXPath works based on the layout of the windows and elements within. When they are different, the XPath will HAVE to be different.

If you want the same XPath to work in both versions then you will need to create a path that will find both, usually by heavily using Regex.

However, you should probably be using different repository objects for each version, and create different test module sets for each version as well.

Re: Different XPath in different Windos Design

Posted: Wed Oct 28, 2015 6:36 pm
by A_C
What do you mean with different versions? Its always Windows7.

Just the Design / Style is different (Control Panel\All Control Panel Items\Personalization).

Re: Different XPath in different Windos Design

Posted: Wed Oct 28, 2015 6:42 pm
by krstcs
When I said 'version', I meant each version of the control panel layout, not different versions of Windows.

You said 'Windows Classic' and 'Windows 7 Basic' in your original post. These are two very different layouts/designs/styles. The XPath will be different. It does not matter if they are both Windows 7, the LAYOUT is different for the two windows BECAUSE the design/style is different.

Re: Different XPath in different Windos Design

Posted: Wed Oct 28, 2015 11:10 pm
by Support Team
Can you still post Ranorex snapshots of the control from the two systems, please?

The second path from the Windows 7 Basic system looks a bit strange in my eyes and could also be caused by a object recognition limitation.

Regards,
Alex
Ranorex Team

Re: Different XPath in different Windos Design

Posted: Thu Oct 29, 2015 8:35 am
by A_C
Here are the snapshots.

@krstcs Thanks

Re: Different XPath in different Windos Design

Posted: Thu Oct 29, 2015 11:36 am
by Support Team
krstcs was right, there are completely different controls depending on the Windows styles.

IMHO this is not common for every UI technology, but this seems to be a Delphi application that obviously exposes that behavior. I.e. to me it looks like the Delphi application does not just change its style, but its complete control layout when switching Windows styles.
Unfortunately, there is nothing we can do from our side to provide a single element representation in such a case.

Regards,
Alex
Ranorex Team