/// <summary> /// Starts a test. /// </summary> /// <param name="mainWindow">The main top-level window of the AUT.</param> /// <param name="appName">The name of the application under test.</param> /// <param name="testName">The test name.</param> /// <param name="viewportSize">The required application's client area viewport size /// or <c>Size.Empty</c> to allow any viewport size.</param> public void Open( UITestControl mainWindow, string appName, string testName, Size viewportSize) { ArgumentGuard.NotNull(mainWindow, nameof(mainWindow)); if (0 == SafeNativeMethods.GetWindowThreadProcessId(mainWindow.WindowHandle, out uint pid)) { var message = "Failed to obtain the process underlying window '{0}'" .Fmt(mainWindow.WindowHandle); Logger.Log("Open(): {0}", message); throw new EyesException(message); } OpenBase((int)pid, appName, testName, viewportSize); EyesMouse.Attach(Logger, this); EyesKeyboard.Attach(Logger, this); }