public void OpenEdgeBrowser() { IWebDriver driver = null; try { driver = WebDriverFactory.GetBrowserWithDefaultConfiguration(BrowserType.Edge); driver.Navigate().GoToUrl(Config.GetValueForSection(ConfigSection.SeleniumMaqs, "WebSiteBase")); } catch { // May need to run headless on some systems var headlessEdgeOptions = WebDriverFactory.GetDefaultEdgeOptions(); headlessEdgeOptions.AddArgument("--no-sandbox"); headlessEdgeOptions.AddArguments("--headless"); driver = WebDriverFactory.GetEdgeDriver(SeleniumConfig.GetCommandTimeout(), headlessEdgeOptions); driver.Navigate().GoToUrl(Config.GetValueForSection(ConfigSection.SeleniumMaqs, "WebSiteBase")); } finally { driver?.KillDriver(); } }
public void GetDefaultEdgeOptions() { var options = WebDriverFactory.GetDefaultEdgeOptions(); Assert.IsNotNull(options, "Was unable to retrieve options for Edge Options"); }