public void Setup() { ChromeService = ChromeDriverService.CreateDefaultService(); ChromeService.Start(); Chrome = new RemoteWebDriver(ChromeService.ServiceUrl, DesiredCapabilities.Chrome()); }
public static ChromeDriverService CreateAndStartChromeService() { var driverPath = System.Environment.GetEnvironmentVariable("CHROMEDRIVER"); _driverService = ChromeDriverService.CreateDefaultService(driverPath); _driverService.Start(); return _driverService; }
public WebHelper() { OpenQA.Selenium.Chrome.ChromeDriverService service = OpenQA.Selenium.Chrome.ChromeDriverService.CreateDefaultService(); OpenQA.Selenium.Chrome.ChromeOptions chromeOptions = new OpenQA.Selenium.Chrome.ChromeOptions(); driver = new ChromeDriver(service, chromeOptions, TimeSpan.FromSeconds(180)); baseURL = "https://scryptmail.com/"; rnd = new Random(); waitPeriod = 30.0; logs = ""; pathLogs = System.IO.Directory.GetCurrentDirectory() + @"\logs.txt"; pathLP = System.IO.Directory.GetCurrentDirectory() + @"\lp.txt"; checkLogsFile(); checkLPFile(); }
/// <summary> /// Initializes a new instance of the <see cref="ChromeDriver"/> class using the specified <see cref="ChromeDriverService"/>. /// </summary> /// <param name="service">The <see cref="ChromeDriverService"/> to use.</param> /// <param name="options">The <see cref="ChromeOptions"/> to be used with the Chrome driver.</param> /// <param name="commandTimeout">The maximum amount of time to wait for each command.</param> public ChromeDriver(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout) : base(new DriverServiceCommandExecutor(service, commandTimeout), options.ToCapabilities()) { }
/// <summary> /// Initializes a new instance of the <see cref="ChromeDriver"/> class using the specified /// <see cref="ChromeDriverService"/> and options. /// </summary> /// <param name="service">The <see cref="ChromeDriverService"/> to use.</param> /// <param name="options">The <see cref="ChromeOptions"/> used to initialize the driver.</param> public ChromeDriver(ChromeDriverService service, ChromeOptions options) : this(service, options, RemoteWebDriver.DefaultCommandTimeout) { }
/// <summary> /// Initializes a new instance of the <see cref="ChromeDriver"/> class using the specified driver service. /// </summary> /// <param name="service">The <see cref="ChromeDriverService"/> used to initialize the driver.</param> public ChromeDriver(ChromeDriverService service) : this(service, new ChromeOptions()) { }
public void Teardown() { Chrome.Quit(); Chrome.Dispose(); Chrome = null; ChromeService.Dispose(); ChromeService = null; }
public SpecCompliantChromeDriver(ChromeDriverService service, ChromeOptions options) : base(service, options) { }
public ChromeDriverWrapper(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout) : base(service, options, commandTimeout) { SeleniumTestBase.LogDriverId(this, "CTOR - ChromeDriver"); }
public ChromeDriverWrapper(ChromeDriverService service, ChromeOptions options) : base(service, options) { SeleniumTestBase.LogDriverId(this, "CTOR - ChromeDriver"); }
protected static void StartDriver() { try { ChromeDriverService service = null; Blackbaud.UAT.SpecFlow.Selenium.RemoteWebDriver driver = null; string remoteUrl = ConfigurationManager.AppSettings["RemoteDriver"]; if ("false" == remoteUrl.ToLower()) { service = BaseTest.InitializeChromeService(); Test.service = service; driver = BaseTest.InitializeChromeDriver(service.ServiceUrl); } else { driver = new Blackbaud.UAT.SpecFlow.Selenium.RemoteWebDriver(new Uri(remoteUrl), DesiredCapabilities.Chrome()); } Test.driver = driver; if (Test.service != null) ScenarioContext.Current.Add("Service", service); if (Test.driver != null) ScenarioContext.Current.Add("Driver", driver); } catch (Exception e) { Console.WriteLine(e.Message); //Do nothing if context is unavailable } }
/// <summary> /// Initializes a new instance of the <see cref="ChromeDriver"/> class using the specified <see cref="ChromeDriverService"/>. /// </summary> /// <param name="service">The <see cref="ChromeDriverService"/> to use.</param> /// <param name="options">The <see cref="ChromeOptions"/> to be used with the Chrome driver.</param> /// <param name="commandTimeout">The maximum amount of time to wait for each command.</param> public ChromeDriver(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout) : base(service, options, commandTimeout) { this.AddCustomChromeCommands(); }
public SpecCompliantChromeDriver(ChromeDriverService service) : this(service, DefaultOptions) { }
/// <summary> /// Initializes a new instance of the <see cref="ChromeCommandExecutor"/> class. /// </summary> /// <param name="driverService">The <see cref="ChromeDriverService"/> that drives the browser.</param> /// <param name="commandTimeout">The maximum amount of time to wait for each command.</param> public ChromeCommandExecutor(ChromeDriverService driverService, TimeSpan commandTimeout) : base(GetDriverServiceUrl(driverService), commandTimeout) { this.service = driverService; }
/// <summary> /// Initializes a new instance of the ChromeDriver class using the specified <see cref="ChromeDriverService"/>. /// </summary> /// <param name="service">The <see cref="ChromeDriverService"/> to use.</param> /// <param name="capabilities">The desired capabilities of the Chrome driver.</param> /// <param name="commandTimeout">The maximum amount of time to wait for each command.</param> private ChromeDriver(ChromeDriverService service, ICapabilities capabilities, TimeSpan commandTimeout) : base(new ChromeCommandExecutor(service, commandTimeout), capabilities) { }
/// <summary> /// Initializes a new instance of the ChromeDriver class using the specified <see cref="ChromeDriverService"/>. /// </summary> /// <param name="service">The <see cref="ChromeDriverService"/> to use.</param> /// <param name="commandTimeout">The maximum amount of time to wait for each command.</param> private ChromeDriver(ChromeDriverService service, TimeSpan commandTimeout) : base(new ChromeCommandExecutor(service, commandTimeout), DesiredCapabilities.Chrome()) { }
private static Uri GetDriverServiceUrl(ChromeDriverService driverService) { Uri driverUrl = null; if (driverService != null) { driverUrl = driverService.ServiceUrl; } return driverUrl; }