[WPF] Visual Object in Control not detected by the spy

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
btanghe
Posts: 3
Joined: Wed Jul 25, 2012 3:04 pm

[WPF] Visual Object in Control not detected by the spy

Post by btanghe » Wed Jul 25, 2012 3:15 pm

Hello,

We have problems in recognizing some WPF objects with Ranorex Spy.

These objects are components System.Windows.Media.Visual.

I provide a test application based on our final product and with these objects not detected and the Ranorex snapshot.

Sincerely,

Benoit

PS: sorry for the quality of the code, I'm not developer !
You do not have the required permissions to view the files attached to this post.

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

Re: [WPF] Visual Object in Control not detected by the spy

Post by Support Team » Thu Jul 26, 2012 2:35 pm

Hi,

I'm sorry to tell you that it is not possible to detect Visual-objects since Visual has no automation element support. What you can do is to switch to the UIElement class. Further, your EditableDataGrid needs to be extended. More precisely, accessibility needs to be implemented.

The developers in your team may give you more information about how this is done precisely.

In the attachment you will find your project including the mentioned extensions.

Kind Regards,
Larissa
Ranorex Support Team
You do not have the required permissions to view the files attached to this post.

btanghe
Posts: 3
Joined: Wed Jul 25, 2012 3:04 pm

Re: [WPF] Visual Object in Control not detected by the spy

Post by btanghe » Thu Jul 26, 2012 2:48 pm

Thank you very much for your reply. Indeed, we can detect the element with the code provided. I send these informations to our development team.

btanghe
Posts: 3
Joined: Wed Jul 25, 2012 3:04 pm

Re: [WPF] Visual Object in Control not detected by the spy

Post by btanghe » Fri Jul 27, 2012 9:24 am

We have another object which is not detected by the Spy, this is a common wpf button declared in the xaml under the datagrid, can you tell us why it is not detected :

<ControlTemplate TargetType="custom:EditableDataGrid">
...
<Button x:Name="_btnMinus" DockPanel.Dock="Right" Margin="3,0" Height="20" Visibility="Visible" AutomationProperties.AutomationId="ddd">-</Button>
...
</ControlTemplate>
You do not have the required permissions to view the files attached to this post.

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

Re: [WPF] Visual Object in Control not detected by the spy

Post by Support Team » Fri Jul 27, 2012 1:52 pm

Hi,

The reason you can't spy this button is again an accessibility problem. Since you use a customized DataGrid you need to extend your EditableDataGrid again.

Kind Regards,
Larissa
Ranorex Support Team