public static string GetInfo(this IUiElement element)
{
string resultString = string.Empty;
if (null == element) return resultString;
try {
if (null == element.GetCurrent()) return resultString;
if (!string.IsNullOrEmpty(element.GetCurrent().Name)) return element.GetCurrent().Name;
if (!string.IsNullOrEmpty(element.GetCurrent().AutomationId)) return element.GetCurrent().AutomationId;
if (!string.IsNullOrEmpty(element.GetCurrent().ClassName)) return element.GetCurrent().ClassName;
} catch (Exception) {
return resultString;
}
return resultString;
}