private void SetWebDriverToIE() { var driverPath = AppConfiguration.BrowserDirectory + UtilityHelpers._separator + "InternetExplorer" + UtilityHelpers._separator + _ieDir; _service = InternetExplorerDriverService.CreateDefaultService(driverPath); var _settings = new InternetExplorerOptions { IntroduceInstabilityByIgnoringProtectedModeSettings = true, EnableNativeEvents = true, IgnoreZoomLevel = true }; try { _service.Start(); } catch (DriverServiceNotFoundException err) { throw new DriverServiceNotFoundException(err.Message); } _capabilities = DesiredCapabilities.InternetExplorer(); WebDriver = new RemoteWebDriver(_service.ServiceUrl, _capabilities); }
private void SetWebDriverToIE() { var driverExePath = _driverPaths + "ie" + Path.DirectorySeparatorChar + _ieDriverServer; _driverservice = InternetExplorerDriverService.CreateDefaultService(driverExePath); var settings = new InternetExplorerOptions { IntroduceInstabilityByIgnoringProtectedModeSettings = true, EnsureCleanSession = true }; try { _driverservice.Start(); } catch (Exception err) { throw new DriverServiceNotFoundException(err.Message); } _capabilities = DesiredCapabilities.InternetExplorer(); SetAdditionalCapabilities(); WebDriver = new ScreenShotRemoteWebDriver(_driverservice.ServiceUrl, _capabilities); }
private void SetWebDriverToChrome() { var driverPath = AppConfiguration.BrowserDirectory + UtilityHelpers._separator + "Chrome" + UtilityHelpers._separator + _chromeDir; _service = ChromeDriverService.CreateDefaultService(driverPath); try { _service.Start(); } catch (DriverServiceNotFoundException err) { throw new DriverServiceNotFoundException(err.Message); } _capabilities = DesiredCapabilities.Chrome(); WebDriver = new RemoteWebDriver(_service.ServiceUrl, _capabilities); }
private void SetWebDriverToChrome() { var driverExePath = _driverPaths + "chrome" + Path.DirectorySeparatorChar + _chromedriver; _driverservice = ChromeDriverService.CreateDefaultService(driverExePath); var settings = new ChromeOptions { BinaryLocation = "", LeaveBrowserRunning = true }; try { _driverservice.Start(); } catch (Exception err) { throw new DriverServiceNotFoundException(err.Message); } _capabilities = DesiredCapabilities.Chrome(); SetAdditionalCapabilities(); WebDriver = new ScreenShotRemoteWebDriver(_driverservice.ServiceUrl, _capabilities); }