Beispiel #1
0
        public override void Start(Browser browser)
        {
            string executionFolder = DriverExecutablePathResolver.GetDriverExecutablePath();

            switch (browser)
            {
            case Browser.Chrome:
                _webDriver = new ChromeDriver(executionFolder);
                break;

            case Browser.Firefox:
                _webDriver = new FirefoxDriver(executionFolder);
                break;

            case Browser.Edge:
                _webDriver = new EdgeDriver(executionFolder);
                break;

            case Browser.Opera:
                _webDriver = new OperaDriver(executionFolder);
                break;

            case Browser.Safari:
                _webDriver = new SafariDriver(executionFolder);
                break;

            case Browser.InternetExplorer:
                _webDriver = new InternetExplorerDriver(executionFolder);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(browser), browser, null);
            }

            _webDriverWait = new WebDriverWait(_webDriver, TimeSpan.FromSeconds(30));
        }
 public void GlobalSetup()
 {
     _driver             = new ChromeDriver(DriverExecutablePathResolver.GetDriverExecutablePath());
     _javaScriptExecutor = (IJavaScriptExecutor)_driver;
     _driver.Navigate().GoToUrl(TestPage);
 }