public ElementTree FindInTree(String name, ControlType controlType, String[] ancestorList) { String ct = "IGNORE"; if (controlType != null) { ct = controlType.LocalizedControlType.ToString(); } ofl.AddLine("Scanning for \"" + name + "\" - " + " Control Type: " + ct); ElementTree res = FindInTreeIMP(name, controlType, ancestorList); if (res != null) { ofl.AddLine("Success! Found element \"" + res.GetName() + "\" - " + res.GetAutomationElement().Current.ControlType.LocalizedControlType); } else { ofl.AddLine("Error! No matching element found."); } return(res); }