Page 1 of 1

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

Posted: Wed Jul 25, 2012 3:15 pm
by btanghe
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 !

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

Posted: Thu Jul 26, 2012 2:35 pm
by Support Team
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

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

Posted: Thu Jul 26, 2012 2:48 pm
by btanghe
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.

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

Posted: Fri Jul 27, 2012 9:24 am
by btanghe
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>

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

Posted: Fri Jul 27, 2012 1:52 pm
by Support Team
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