public string GetErrorMessage() { var loginScreen = GetLoginScreen(); var errorLabel = DelegateExtensions.ExecuteWithResult(() => loginScreen.Get <Label>(SearchCriteria.ByAutomationId("Login_FailureTextBlock")), r => r.Text, new[] { null, string.Empty }); return(errorLabel.Text); }
internal Window GetShell() { var application = ApplicationContext.Application; var shellScreen = DelegateExtensions.ExecuteWithResult( () => application.GetWindow(SearchCriteria.ByAutomationId("Shell_Window"), InitializeOption.NoCache)); shellScreen.WaitWhileBusy(); return(shellScreen); }
internal Window GetShell() { var application = ApplicationContext.Application; application.WaitWhileBusy(); using (var automation = new UIA3Automation()) { var shellScreen = DelegateExtensions.ExecuteWithResult( () => application.GetAllTopLevelWindows(automation) .FirstOrDefault(t => t.Properties.AutomationId == "Shell_Window")); return(shellScreen); } }