//InitializeBrowser method is used to create and launch the instance of the chosen browser public static void InitializeBrowserType() { //Point the object repository config property to the application reader class. ObjectRepository.ConfigurationManager = new AppConfigurationReader(); //Use the GetBroswer method to check with broswer to use switch (ObjectRepository.ConfigurationManager.GetBrowserType()) { case "CHROME": ObjectRepository.Driver = DriverTypeManager.GetChromeDriver(); break; default: throw new Exception("The Browser that you require is not vaild please check App.config file"); } }
//InitializeBrowser method is used to create and launch the instance of the chosen browser public static void InitializeBrowser() { //Point the objectrepositories iconfig property to the application reader class. ObjectRepositories.IConfig = new ApplicationConfigurationReader(); //Use the GetBroswer method to check with broswer to use based on the enum. switch (ObjectRepositories.IConfig.GetBrowser()) { case BrowserType.CHROME: ObjectRepositories.Driver = DriverTypeManager.CreateChromeDriver(); break; default: throw new InvalidDriverException("The driver which has been specified is invalid"); } }