Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get the AutomationElement for a WPF Popup

I'm working on a project that uses a popup in an editor to provide objects in a ListBox for users to double click in order to add them to their document. I'm trying to create automated tests for the app using the Automation API provided by microsoft, but I can't figure out how to get the AutomationElement for a Popup control, since it's in a different tree than my editor and its controls. Does anybody know how to get the AutomationElement for a WPF Popup ?

like image 704
Alex Marshall Avatar asked May 06 '11 16:05

Alex Marshall


1 Answers

I wound up having to start at the Desktop and query through the automation tree using some very specific PropertyConditions combined with an AndCondition, using TreeScope.Descendants as a parameter for my queries.

like image 124
Alex Marshall Avatar answered Oct 16 '22 23:10

Alex Marshall