Recording of mixed Win32 and WPF GUI elements

Ranorex Spy, Recorder, and Studio.
danielku15
Posts: 4
Joined: Wed Jul 13, 2016 7:18 am

Recording of mixed Win32 and WPF GUI elements

Post by danielku15 » Wed Jul 13, 2016 8:27 am

Hi Ranorexers.

In our GUI we have currently a mix of legacy Win32 GUI elements and some new WPF elements utilizing the HwndSource interopability classes. The problem is that Ranorex cannot detect clicks on those WPF elements.

For instance our Help>About opens a WPF overlay which has a close button. Ranorex properly records the clicks on Help and About. But then when I want add validations to WPF elements or record the close on it, the recorder only highlights the native GUI elements which are "behind" the overlay.

is this a known issue?

Kind Regards
Daniel

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

Re: Recording of mixed Win32 and WPF GUI elements

Post by odklizec » Wed Jul 13, 2016 8:47 am

Hi Daniel,

Unfortunately, it's pretty hard to say what's wrong without additional details.
What version of Ranorex do you use (latest is 6.0.1)?
Please upload a Ranorex snapshot (not screenshot!) of the problematic element/app taken when both win32 and wpf GUI is loaded.

BTW, recording actions/elements is not the only way how to add actions/validations to recording. You can always add the validation steps and store elements to repository by drag&drop elements from spy. So make sure you see the elements in spy, locate the problematic element and drag&drop it to recording.
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

danielku15
Posts: 4
Joined: Wed Jul 13, 2016 7:18 am

Re: Recording of mixed Win32 and WPF GUI elements

Post by danielku15 » Wed Jul 13, 2016 9:57 am

Here are some more details:

I'm using Ranorex 6.0.1 (downloaded yesterday) and I attached a snapshot of the GUI to this post. The WPF element is the "LicenseOverlayControl" which is properly shown in the tree. Also when selecting the items in the tree they are highlighted. But when using the "Track" feature to select the controls they are not highlighted. I know that items can be added later on but when doing complete test-workflows and suddenly some essential GUI elements are not recorded is quite misleading for the people recording the test. Also adding all steps manually afterwards is quite some effort compared to using the very handy recording features.

Ranorex Spy shows a warning message when entering selecting the WPF elements:

Technology: WPF
You are accessing WPF elements via the UIA plug-in. UI element identification capabilities for this window are limited. Consider using the native WPF plug-in.

In the Global Settings I've selected WPF Legacy/UIA Interaction as WpfPreferred and enabled "Show All Elements".
Attachments
GUISnapShot.rxsnp
(982.21 KiB) Downloaded 46 times

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

Re: Recording of mixed Win32 and WPF GUI elements

Post by Support Team » Tue Jul 19, 2016 12:21 pm

Hello danielku15,

Thank you for the snapshot file. Unfortunately, there is no WPF overlay available in the snapshot. I think it would be the best having a remote session in order to analyze the issue on your machine directly. May I ask you to send an e-mail to [email protected]? We will get back to you as soon as possible.

Regards,
Bernhard
.
Image

danielku15
Posts: 4
Joined: Wed Jul 13, 2016 7:18 am

Re: Recording of mixed Win32 and WPF GUI elements

Post by danielku15 » Mon Oct 03, 2016 5:11 pm

Hello Bernhard.

Sorry for the late response. Since there is no E-mail Notification upon new forum posts here, I completely missed your response. (Maybe I missed some profile setting?).

Anyhow: I prepared a small standalone application that you can test on your side (.net 4.5.1 and Visual C++ 2012 are required).

The normal UI is a MFC MDI application, more or less the default output when creating a new MFC MDI project. When you click on Help -> About MDI the WPF overlay opens. Showing a panel with a WPF button. Clicking on it will show a messagebox and closes the overlay.

In Ranorex Spy, if you click on "Track", it will only highlight the MFC elements. But when you check the Tree-View in Ranorex Spy, you will see that there is a Container 'WPFOverlay" with a button in it. I hope this helps you on reproducing the issue on your side.

So far I found out that it might have to do something with the MDI. When I created a normal dialog based MFC application, the Track button worked.
Attachments
Mdi.zip
Example Application with a WPF overlay.
(104.2 KiB) Downloaded 39 times

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

Re: Recording of mixed Win32 and WPF GUI elements

Post by Support Team » Tue Oct 11, 2016 11:35 am

Hello danielku15,

Thank you for providing the sample application. I can see the issue now. It seems to be a very specific issue especially with the layout of your application. As you already wrote, it is possible to find the element in the element tree in Ranorex Spy and add it to the repository. Unfortunately, it is not possible to find the elements during the recording because of the win32 overlay. If adding the correct elements to the repository is not a suitable workaround for you, please send an e-mail to [email protected]. I will try to find another workaround.

Regards,
Bernhard
.
Image