public SeleniumBrowser(ISeleniumDriverFactory seleniumDriverFactory, ISweetPotatoSettings sweetPotatoSettings, ISeleniumElementFactory seleniumElementFactory) { _seleniumElementFactory = seleniumElementFactory; _sweetPotatoSettings = sweetPotatoSettings; var browserType = sweetPotatoSettings.GetBrowserType(); _webDriver = seleniumDriverFactory.Create(browserType, sweetPotatoSettings.GetDriverPath()); Elements = new List <ElementLookup>(); }
public IAutomationBrowser CreateBrowser(ISweetPotatoSettings sweetPotatoSettings) { ScenarioContext.Current.Set(sweetPotatoSettings.GetExecutingAssemblyName(), Constants.ImplementingAssemblyName); //ScenarioContext.Current.Set(sweetPotatoSettings.GetWaitTimeMilliseconds(), // Constants.WaitTimeMilliseconds); //ScenarioContext.Current.Set(sweetPotatoSettings.IsElementHighlighterEnabled(), // Constants.IsElementHighlighterEnabled); switch (sweetPotatoSettings.GetDriverType()) { case DriverType.Selenium: var automationBrowser = GetSeleniumBrowser(sweetPotatoSettings); SetAutomationBrowserToScenarioContext(automationBrowser); return(automationBrowser); default: var seleniumBrowser = GetSeleniumBrowser(sweetPotatoSettings); SetAutomationBrowserToScenarioContext(seleniumBrowser); return(seleniumBrowser); } }
private static IAutomationBrowser GetSeleniumBrowser(ISweetPotatoSettings sweetPotatoSettings) { var seleniumDriverFactory = new SeleniumDriverFactory(); return(new SeleniumBrowser(seleniumDriverFactory, sweetPotatoSettings, new SeleniumElementFactory())); }