public void SelecionarBrowser(EnumNavegador navegador) { switch (navegador) { case EnumNavegador.Chrome: _driver = new ChromeDriver(); _objectContainer.RegisterInstanceAs <IWebDriver>(_driver); break; case EnumNavegador.Firefox: _driver = new FirefoxDriver(); _objectContainer.RegisterInstanceAs <IWebDriver>(_driver); break; case EnumNavegador.IE: _driver = new InternetExplorerDriver(); _objectContainer.RegisterInstanceAs <IWebDriver>(_driver); break; case EnumNavegador.Edge: _driver = new EdgeDriver(); _objectContainer.RegisterInstanceAs <IWebDriver>(_driver); break; case EnumNavegador.Chrome_Headless: ChromeOptions option = new ChromeOptions(); option.AddArgument("--headless"); _driver = new ChromeDriver(option); _objectContainer.RegisterInstanceAs <IWebDriver>(_driver); break; } }
public void InitializeTest() { var browser = TestContext.Parameters.Get("Browser", "Chrome"); _browser = (EnumNavegador)System.Enum.Parse(typeof(EnumNavegador), browser); SelecionarBrowser(_browser); _driver.Manage().Window.Maximize(); _driver.Navigate().GoToUrl("http://executeautomation.com/demosite/Login.html"); }