Different XPath in different Windos Design

Ranorex Spy, Recorder, and Studio.
A_C
Posts: 11
Joined: Fri Jun 21, 2013 11:23 am

Different XPath in different Windos Design

Post by A_C » Wed Oct 28, 2015 5:18 pm

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.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Different XPath in different Windos Design

Post by krstcs » Wed Oct 28, 2015 6:22 pm

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.
Shortcuts usually aren't...

A_C
Posts: 11
Joined: Fri Jun 21, 2013 11:23 am

Re: Different XPath in different Windos Design

Post by A_C » Wed Oct 28, 2015 6:36 pm

What do you mean with different versions? Its always Windows7.

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

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Different XPath in different Windos Design

Post by krstcs » Wed Oct 28, 2015 6:42 pm

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.
Shortcuts usually aren't...

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

Re: Different XPath in different Windos Design

Post by Support Team » Wed Oct 28, 2015 11:10 pm

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
.
Image

A_C
Posts: 11
Joined: Fri Jun 21, 2013 11:23 am

Re: Different XPath in different Windos Design

Post by A_C » Thu Oct 29, 2015 8:35 am

Here are the snapshots.

@krstcs Thanks
Attachments
Windows7_Basic.rxsnp
(17.28 KiB) Downloaded 45 times
Windows_classic.rxsnp
(13.51 KiB) Downloaded 49 times

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

Re: Different XPath in different Windos Design

Post by Support Team » Thu Oct 29, 2015 11:36 am

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
.
Image