public static void InitDriver(BrowserType browser, Configuration config = null) { config = config ?? new Configuration(); switch (browser) { case BrowserType.Chrome: ChromeBrowserDriver chrmoedriverInstance = new ChromeBrowserDriver(); chrmoedriverInstance.InitDriver(config); DriverStored = chrmoedriverInstance.Driver; break; case BrowserType.FireFox: FirefoxBrowserDriver firefoxdriverInstance = new FirefoxBrowserDriver(); firefoxdriverInstance.InitDriver(config); DriverStored = firefoxdriverInstance.Driver; break; } }
// override public void CreateInstance() { AbstractBrowserDriver driver = null; switch ("CHROME")//TODO: Pick from config file { case "FIREFOX": driver = new FirefoxBrowserDriver(); break; case "CHROME": driver = new ChromeBrowserDriver(); break; case "IE": driver = new InternetExplorerBrowserDriver(); break; } webDriver = driver.GetDriver(); }