private static RemoteWebDriver CreateDriver() { var browser = BrowserFactory.GetBrowser(Configuration.Browser); var useSauceLabs = Configuration.UseSauceLabs; var useSeleniumGrid = Configuration.UseSeleniumGrid; var nodePlatform = Configuration.NodePlatform; var capabilities = browser.Capabilities(useSauceLabs, useSeleniumGrid, nodePlatform); if (useSauceLabs) { var user = Configuration.SauceLabsUser; var key = Configuration.SauceLabsKey; capabilities.SetCapability("username", user); capabilities.SetCapability("accessKey", key); return(new RemoteWebDriver(new Uri($"http://ondemand.saucelabs.com:80/wd/hub"), capabilities)); } if (useSeleniumGrid) { var url = new Uri(Configuration.HubUrl); return(new RemoteWebDriver(url, capabilities)); } return((RemoteWebDriver)browser.Instance); }
public static RemoteWebDriver CreateDriver() { var browser = BrowserFactory.GetBrowser(ConfigurationManager.AppSettings["Browser"]); var useSauceLabs = bool.Parse(ConfigurationManager.AppSettings["UseSauceLabs"]); var useSeleniumGrid = bool.Parse(ConfigurationManager.AppSettings["UseSeleniumGrid"]); var nodePlatform = ConfigurationManager.AppSettings["NodePlatform"]; var capabilities = browser.Capabilities(useSauceLabs, useSeleniumGrid, nodePlatform); if (useSauceLabs) { var user = ConfigurationManager.AppSettings["SauceLabsUser"]; var key = ConfigurationManager.AppSettings["SauceLabsKey"]; capabilities.SetCapability("username", user); capabilities.SetCapability("accessKey", key); return(new RemoteWebDriver(new Uri($"http://ondemand.saucelabs.com:80/wd/hub"), capabilities)); } if (useSeleniumGrid) { var url = new Uri(ConfigurationManager.AppSettings["HubUrl"]); return(new RemoteWebDriver(url, capabilities)); } return((RemoteWebDriver)browser.Instance); }
public void BeforeScenario() { FeatureContextWrapper.BrowserSession = BrowserFactory.GetBrowser(); Twitter.LoginPage = new LoginPage(); Twitter.HomePage = new HomePage(); }
public IEnumerable <InstalledBrowser> GetInstalledBrowsers() { var installedBrowsers = MintPlayer.PlatformBrowser.PlatformBrowser.GetInstalledBrowsers().ToList(); // Filter browsers if (installedBrowsers.Any(x => (new FileInfo(x.Version.FileName)).Name.Equals(ChromiumEdgeFactory.FILENAME, StringComparison.OrdinalIgnoreCase))) { installedBrowsers = installedBrowsers .Where(x => !(new FileInfo(x.Version.FileName)).Name.Equals(MicrosoftEdgeFactory.FILENAME, StringComparison.OrdinalIgnoreCase)) .ToList(); } return(installedBrowsers.Select(x => { // Determine specific properties for specific browsers BrowserFactory browserFactory; switch ((new FileInfo(x.Version.FileName)).Name) { case ChromeFactory.FILENAME: browserFactory = new ChromeFactory(x); break; case ChromiumEdgeFactory.FILENAME: browserFactory = new ChromiumEdgeFactory(x); break; default: browserFactory = new BrowserFactory(x); break; } return browserFactory.GetBrowser(); }).ToList()); }
public HomePageSteps(App app) { // shared data injection _app = app; // init app _app.Browser = BrowserFactory.GetBrowser(); _app.HomePage = new HomePage(_app.Browser); }
public override void InitTest() { browser = BrowserFactory.GetBrowser(Configuration.Browser, Configuration.ElementTimeout); browser.GoToUrl(Configuration.StartUrl); if (LoginSteps.IsLogIn(browser)) { LoginSteps.LogOut(browser); } logger.Info("Logout"); }
public void Test() { IWebDriver browser = BrowserFactory.GetBrowser(); browser.Navigate().GoToUrl("epam.com"); //Assert.Equals("EPAM | Software Product Development Services", browser.Title); browser.Close(); }
public static void Setup(Type testType, string testName) { Logger.Configure(); TestExecutionContext.TestType = testType; TestExecutionContext.TestName = testName; if (TestExecutionContext.IsWebDriverTest) { TestExecutionContext.Browser = BrowserFactory.GetBrowser(); TestExecutionContext.BrowserActions.NavigateToStartUri(); } }
public void OneTimeSetup() { //Setup data here //create a list of test customers to use. this is our test data Dictionary <string, string> custValues = new Dictionary <string, string>() { { "2736201", "Julie Barker" }, { "2661515", "Mary Anderson" } }; //create a phone event with an appnt IWebDriver driver = BrowserFactory.GetBrowser(); new LoginPage(driver).OpenUrlAndLogin(); new BasePage(driver).AddPhoneEvent(custValues.Keys.First()); driver.Quit(); }
public static void BeforeTestRun() { FeatureContextWrapper myWrapper = new FeatureContextWrapper(); myWrapper.BrowserSession = BrowserFactory.GetBrowser(); }
public void OneTimeSetup() { driver = BrowserFactory.GetBrowser(); new LoginPage(driver).OpenUrlAndLogin(); }
public AccountCreationFeatureSteps() { Driver = BrowserFactory.GetBrowser(); }
public virtual void InitTest() { browser = BrowserFactory.GetBrowser(Configuration.Browser, Configuration.ElementTimeout); browser.GoToUrl(Configuration.StartUrl); LoginSteps.Login(browser, user); }