I want to automate a .NET WinForm appliacation using Teststack White and System.Windows.Automation in c#.
There are at a time several opened windows under MdiClient, I want to get the list of all the sub-windows opened under MdiClient.
I try:
var window = application.GetWindows().Find(obj => obj.Title.StartsWith("Helios Green"));
window.Focus(DisplayState.Maximized);
AutomationElementCollection allChildren =
window.AutomationElement.FindAll(TreeScope.Children,
new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Window));
But this returns empty collection, since the MdiChlidren Windows are not directly children of the main Window, but there is a MdiClient Class Name =WindowsForms10.MDICLIENT.app.0.33c0d9d in between, as seen in Inspect.
How to get the list of all opened MDI sub-windows?