cancel
Showing results for 
Search instead for 
Did you mean: 

WPF Automation peers

Highlighted
New Contributor

WPF Automation peers

Hi,

 

What do I need to do for Test Complete to be able to recognize  WPF objects's automation peer id/name?

 

If that is not possible. Is there any way to write a custom script that would extract the WPF automation peer id and make it accessible to Test Complete (for object mapping purposes)?

 

References:

 

https://msdn.microsoft.com/en-us/library/ms747327(v=vs.110).aspx

https://msdn.microsoft.com/en-us/library/cc165614(v=vs.110).aspx

 

 

More Details:

 

 

I have the UI Automation plugin enabled and my list of accepted windows is *(all), DirectUIHWND, Windows.UI.Core.CoreWindow

 

List Accepted Windows.PNG

 

 

This allows me to see the UI Automation properties of the main window ONLY, not the buttons.

 

Main Window.PNG

 

..but the XAML does have Automation properties for the buttons:

 

<Button x:Name="Test_B" Content="Test B"

                AutomationProperties.AutomationId="Test A ID"

                AutomationProperties.Name="Test A Name"

                HorizontalAlignment="Left"

                Margin="214,161,0,0"

                VerticalAlignment="Top" Width="75"/>

 

 

 

Am I in the right track here?

 

 

 

4 REPLIES 4
Highlighted
Frequent Contributor
Highlighted
Contributor

Re: WPF Automation peers

Select * checkbox in MSAA in Current Project Seetings

 

or

 

Add WndClass of Main Object in MSAA

 

this is may used to recognize all Objects

Highlighted
Community Hero

Re: WPF Automation peers

Also, http://support.smartbear.com/testcomplete/docs/app-testing/desktop/wpf/template-support.html might appear to be relevant...

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Highlighted
Community Hero

Re: WPF Automation peers


@karthick7 wrote:

Select * checkbox in MSAA in Current Project Seetings

 

or

 

Add WndClass of Main Object in MSAA

 

this is may used to recognize all Objects


This is a UI Automation support problem.  While MSAA might work around it, there is a better solutions as noted by @AlexKaras


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors