public void SetTimeoutsGetWaitDriver() { SeleniumConfig.SetTimeouts(SeleniumConfig.Browser()); WebDriverWait wait = SeleniumConfig.GetWaitDriver(SeleniumConfig.Browser()); Assert.AreEqual(wait.Timeout.TotalMilliseconds.ToString(), Config.GetValue("Timeout", "0")); }
public void GetWaitDriver() { #region WaitDriver WebDriverWait wait = SeleniumConfig.GetWaitDriver(SeleniumConfig.Browser()); #endregion WaitDriver Assert.AreEqual(wait.Timeout.Seconds, 10); Assert.AreEqual(wait.PollingInterval.Seconds, 1); }
public void GetBrowser() { #region GetBrowser IWebDriver driver = SeleniumConfig.Browser(); #endregion GetBrowser Assert.IsNotNull(driver); driver.Close(); driver.Dispose(); }
public void GetBrowserWithString() { #region GetBrowserWithString IWebDriver driver = SeleniumConfig.Browser("phantomjs"); #endregion GetBrowserWithString Assert.IsNotNull(driver); driver.Close(); driver.Dispose(); }
public void GetBrowserRemoteThrowException() { try { Config.AddTestSettingValues( new Dictionary <string, string> { { "HubUrl", "http://localhost:4444/wd/hub" }, { "RemoteBrowser", "NoBrowser" } }, true); IWebDriver driver = SeleniumConfig.Browser("remote"); } finally { // Set the value back to default value, since value can't be removed from the dictionary // Only one other test checks the value of the RemoteBrowser (GetRemoteBrowserName), so hopefully there won't be any parallel conflicts Config.AddTestSettingValues(new Dictionary <string, string> { { "RemoteBrowser", "Chrome" } }, true); } }
public void RemoteCapabilitySectionRespected() { IWebDriver driver = null; try { driver = SeleniumConfig.Browser("Remote"); driver.Navigate().GoToUrl("https://magenic.com/"); } catch (Exception e) { Assert.IsTrue(e.InnerException.Message.Contains("Sauce_Labs_Username"), "Did not see 'Sauce_Labs_Username' in error message: " + e.Message); } finally { // Cleanup if we need to if (driver != null) { driver.Quit(); } } }