public static void HideDriverWindow() { try { string driverExe = ""; string title = ""; if (CurrentDriver is InternetExplorerDriver) { driverExe = "IEDriverServer.exe"; } else if (CurrentDriver is FirefoxDriver) { driverExe = "geckodriver.exe"; } else if (CurrentDriver is ChromeDriver) { driverExe = "chromedriver.exe"; } title = Path.Combine(Path.Combine(Environment.CurrentDirectory, "drivers"), driverExe); AutomationUtils.SetWindowState(title, AutomationUtils.ShowWindowCommands.Hide); } catch { throw; } }
private static void CloseChromeDriver() { string title = Path.Combine(Path.Combine(Environment.CurrentDirectory, "drivers"), "chromedriver.exe"); AutomationUtils.CloseWindowForTitle(title); }