I am looking for a method to "click" a toolbar button in another application using the UIAutomation namespace. The other application is not written by me and I don't have access to the source.
I found the parent window using:
AutomationElement _automationElement = AutomationElement.RootElement.FindFirst(TreeScope.Children, new PropertyCondition(AutomationElement.NameProperty, "Other App"));
I found the toolbar element using:
AutomationElement _toolbarElement = _automationElement.FindFirst(TreeScope.Descendants, new PropertyCondition(AutomationElement.NameProperty, "ToolBar1"));
I've tried to navigate further into the toolbar element for decendents and children and they all returned null. Is there a way to access the individual buttons contained within the toolbar?