Ranorex Spy and FindFromPoint Always Return the Main Form

Class library usage, coding and language questions.
Chris.Crapo
Posts: 1
Joined: Mon Aug 16, 2010 5:29 pm

Ranorex Spy and FindFromPoint Always Return the Main Form

Post by Chris.Crapo » Mon Aug 16, 2010 8:41 pm

Question: Does anyone have a suggestion as to what interactions between/settings of Ranorex and WPF could cause the Ranorex Spy and FindFromPoint() to always return the highest-level WPF form, even though it is actually not the foreground object in the display?

Background: We have a WPF application running on XP SP3 that uses a lot of custom controls. We recently noticed that the Spy and FindFromPoint have started to return the XPath for the form-in-general instead of the specific control that is being selected. The tree view of the application that the Spy provides is still perfectly functional - even asking the Spy to "highlight an element" works correctly – only the "Track" functionality behaves strangely/improperly.

Additional Information: Unfortunately, we were in the middle of heavy changes in both the product and our API based automation environment, and it wasn't until recently that we noticed the issue, so tracking down the specific change in behavior, and attributing it to either Ranorex or our App is quite difficult. To make matters worse, not only do our devs know very little about Ranorex, we don't have anyone on the test team that is familiar with WPF, so I thought I'd post here in case someone has an idea that could lead us to resolving the issue.

Thanks in advance for any ideas,

Chris

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Ranorex Spy and FindFromPoint Always Return the Main Form

Post by Support Team » Tue Aug 17, 2010 5:31 pm

Could you please post a Ranorex snapshot of the application (see this section in the Ranorex User Guide)?

Do you experience that behavior with every control in the application and in every state the application can be in? The question is if that problem is specific to a control or to the main form of the application. Have you tried creating a simple WPF sample with some of your controls and spying that sample application?

Ranorex internally uses UI Automation to interact with WPF applications and specifically to get UI elements at a screen location (used for tracking in Spy). If you have the Windows SDK for Vista installed, you can also try to spy your application using the Microsoft UI Spy Tool:
http://msdn.microsoft.com/en-us/library/ms727247.aspx
http://blogs.msdn.com/b/windowssdk/arch ... y-exe.aspx

Regards,
Alex
Ranorex Team