internal override void StartDriver(Proxy mProxy) { InternetExplorerOptions ieoptions = new InternetExplorerOptions(); ieoptions.EnsureCleanSession = true; ieoptions.IgnoreZoomLevel = true; ieoptions.Proxy = mProxy; ieoptions.EnableNativeEvents = EnableNativeEvents; if (BrowserPrivateMode) { ieoptions.ForceCreateProcessApi = true; ieoptions.BrowserCommandLineArguments = "-private"; } Driver = new InternetExplorerDriver(SeleniumServiceBase.GetDriverPath("InternetExplorer"), ieoptions); }
internal override void StartDriver(Proxy mProxy) { FirefoxOptions FirefoxOption = new FirefoxOptions(); FirefoxOption.Proxy = mProxy; FirefoxOption.AcceptInsecureCertificates = true; if (HeadlessBrowserMode) { FirefoxOption.AddArgument("--headless"); } if (!string.IsNullOrEmpty(UserProfileFolderPath) && System.IO.Directory.Exists(UserProfileFolderPath)) { FirefoxProfile ffProfile2 = new FirefoxProfile(); ffProfile2 = new FirefoxProfile(UserProfileFolderPath); FirefoxOption.Profile = ffProfile2; } Driver = new FirefoxDriver(SeleniumServiceBase.GetDriverPath("FireFox"), FirefoxOption, TimeSpan.FromSeconds(Convert.ToInt32(HttpServerTimeOut))); }
internal override void StartDriver(Proxy mProxy) { ChromeOptions Options = new ChromeOptions(); Options.Proxy = mProxy; if (!(string.IsNullOrEmpty(ExtensionPath) || string.IsNullOrWhiteSpace(ExtensionPath))) { Options.AddExtension(Path.GetFullPath(ExtensionPath)); } if (HeadlessBrowserMode) { Options.AddArgument("--headless"); } if ((!(string.IsNullOrEmpty(UserProfileFolderPath) || string.IsNullOrWhiteSpace(UserProfileFolderPath)) && System.IO.Directory.Exists(UserProfileFolderPath))) { Options.AddArguments("user-data-dir=" + UserProfileFolderPath); } if (!(string.IsNullOrEmpty(DownloadFolderPath) || string.IsNullOrWhiteSpace(DownloadFolderPath))) { if (!System.IO.Directory.Exists(DownloadFolderPath)) { System.IO.Directory.CreateDirectory(DownloadFolderPath); } Options.AddUserProfilePreference("download.default_directory", DownloadFolderPath); } if (BrowserPrivateMode) { Options.AddArgument("--incognito"); } Driver = new ChromeDriver(SeleniumServiceBase.GetDriverPath("Chrome"), Options); }