public virtual IDriverCleanup Create()
        {
            string browserServer;
            string browserProcess;

            var browserTypeValue = _configurationReader.GetConfigurationValue(Constants.Configuration.BrowserTypeKey);
            var browserType      = !string.IsNullOrWhiteSpace(browserTypeValue) ? BrowserTypeMapper.ConvertBrowserValue(browserTypeValue) : BrowserTypes.InternetExplorer;

            switch (browserType)
            {
            case Enums.BrowserTypes.InternetExplorer:
                browserProcess = Enums.BrowserTypes.InternetExplorer.GetDescription();
                browserServer  = BrowserDriverServer.InternetExplorer;
                break;

            case Enums.BrowserTypes.Chrome:
                browserProcess = Enums.BrowserTypes.Chrome.GetDescription();
                browserServer  = BrowserDriverServer.Chrome;
                break;

            case Enums.BrowserTypes.Firefox:
                browserProcess = Enums.BrowserTypes.Firefox.GetDescription();
                browserServer  = BrowserDriverServer.Firefox;
                break;

            default:
                browserProcess = Enums.BrowserTypes.InternetExplorer.GetDescription();
                browserServer  = BrowserDriverServer.InternetExplorer;
                break;
            }

            return(new DriverCleanup(browserServer, browserProcess, _osProcess, _configurationReader));
        }
Example #2
0
        public virtual DriverOptions Create()
        {
            var browserTypeValue = _configurationReader.GetConfigurationValue(Constants.Configuration.BrowserTypeKey);
            var browserType      = !string.IsNullOrWhiteSpace(browserTypeValue) ? BrowserTypeMapper.ConvertBrowserValue(browserTypeValue) : BrowserTypes.InternetExplorer;

            switch (browserType)
            {
            case BrowserTypes.Firefox:
                return(CreateFirefoxDriverOptions());

            case BrowserTypes.InternetExplorer:
                return(CreateInternetExplorerDriverOptions());

            case BrowserTypes.Chrome:
                return(CreateChromeDriverOptions());

            case BrowserTypes.Edge:
                return(CreateEdgeDriverOptions());

            case BrowserTypes.NotSet:
                return(CreateInternetExplorerDriverOptions());

            default:
                return(CreateInternetExplorerDriverOptions());
            }
        }
Example #3
0
        public virtual IWebDriver Create()
        {
            IWebDriver driver;
            var        loginWaitTime = Convert.ToInt64(ConfigurationReader.GetConfigurationValue(Constants.Configuration.LoginWaitTimeKey));

            var browserTypeValue = ConfigurationReader.GetConfigurationValue(Constants.Configuration.BrowserTypeKey);
            var browserType      = !string.IsNullOrWhiteSpace(browserTypeValue) ? BrowserTypeMapper.ConvertBrowserValue(browserTypeValue) : BrowserTypes.InternetExplorer;

            switch (browserType)
            {
            case BrowserTypes.Firefox:
                driver = CreateFirefoxWebDriver(loginWaitTime);
                break;

            case BrowserTypes.InternetExplorer:
                driver = CreateInternetExplorerWebDriver(loginWaitTime);
                break;

            case BrowserTypes.Chrome:
                driver = CreateChromeWebDriver(loginWaitTime);
                break;

            case BrowserTypes.Edge:
                driver = CreateEdgeWebDriver(loginWaitTime);
                break;

            case BrowserTypes.NotSet:
                driver = CreateInternetExplorerWebDriver(loginWaitTime);
                break;

            default:
                driver = CreateInternetExplorerWebDriver(loginWaitTime);
                break;
            }

            return(driver);
        }