I am making a C # Windows form application that automates another win32 application using the System.Windows.Automation classes.
There are some elements that I need to read or interact with, but UISpy does not find these fields, it only found the parent panel of the container.
For example, this code block below should return many toolbar buttons, but it doesn’t work:
var mainWindow = AutomationElement.RootElement.FindChildByNamePart("Back Office Control");
var mainWindowChildren = mainWindow.FindAll(TreeScope.Children, Condition.TrueCondition);
var toolBarPanel = mainWindowChildren[1];
var toolBarItens = toolBarPanel.FindAll(TreeScope.Children, Condition.TrueCondition);
Is there any other way to do this?
source
share