Обрабатывать неподдерживаемое свойство с помощью FlaUI?
Это мой текущий код, который иногда дает сбой и вызывает исключение:
Исключение типа "FlaUI.Core.Exceptions.PropertyNotSupportedException" произошло в FlaUI.Core.dll, но не было обработано в пользовательском коде. Запрошенное свойство "Имя [#30005]" не поддерживается.
public void HandleImportSettingsWindow()
{
using (var automation = new UIA3Automation())
{
var desktop = automation.GetDesktop();
var window = Retry.WhileNull<Window>(
() =>
{
var windows = desktop.FindAllChildren(cf => cf.ByControlType(ControlType.Window));
AutomationElement window = null;
foreach (var w in windows)
{
// TODO: Handle The requested property 'Name [#30005]' is not supported exception.
// Sometimes it is possible to have untitled windows that don't have a "Name" property, such as splash screens.
// The window title can differ but it always includes the word "Import".
if (Regex.Match(w.AsWindow().Title, @"(Import)").Success)
{
window = w;
break;
}
}
return window.AsWindow();
},
timeout: TimeSpan.FromSeconds(10)
).Result;
if (window != null)
{
window.SetForeground();
window.Focus();
Keyboard.Type(VirtualKeyShort.TAB);
Thread.Sleep(400);
Keyboard.Type(VirtualKeyShort.SPACE);
}
}
}
Есть ли у вас какое-либо решение или обходной путь для этой проблемы?