public void InvokePattern_ReadFromButton_CanInvoked() { var button = UI.GetChild(By.AutomationId("CUI_ShowMessageBox_Button"), From.Element(_mainWindow)); var pattern = Patterns.GetInvokePattern(button.AutomationElement); pattern.Invoke(); DynamicSleep.Wait(1000); var messageBox = WindowFinder.Search <BasicMessageBox>(Use.Title("MessageBoxTitle")); messageBox.OKButton.Unsafe.Click(); }
/// <summary> /// Invokes a click on the Button. /// </summary> public void Click() { var pattern = Patterns.GetInvokePattern(_automationElement); pattern.Invoke(); }