using (var app = Application.AttachOrLaunch(Application.FindExe("Gu.Wpf.Geometry.Demo.exe"), "ZoomWindow"))
{
var window = app.MainWindow;
window.FindButton("None").Invoke();
System.Windows.Automation.ElementNotEnabledException
HResult=0x80040200
Message=The operation is not allowed on a nonenabled element.
at MS.Internal.Automation.ElementUtil.Invoke(AutomationPeer peer, DispatcherOperationCallback work, Object arg)
at MS.Internal.Automation.InvokeProviderWrapper.Invoke()
Source=UIAutomationClient
StackTrace:
at MS.Internal.Automation.UiaCoreApi.CheckError(Int32 hr)
at Gu.Wpf.UiAutomation.InvokeControl.Invoke()
at Gu.Wpf.Geometry.UiTests.ZoomWindowTests.MouseWheelTopLeft() in C:\Git\Gu.Wpf.Geometry\Gu.Wpf.Geometry.UiTests\ZoomWindowTests.cs:line 67
Maybe add a wait if not enabled?