Exemple #1
0
        public void StartTestRun()
        {
            // Only a single Service instance is started for the entire test run.
            if (BrowserSettings == null)
            {
                throw new ApplicationException("No '<browserSettings>' section found in App.config file.\r\nEnsure the App.config file exists and it contains a '<browserSettings>' section.");
            }

            DriverService = WebDriverFactory.CreateDriverService(BrowserSettings, TestContext.CurrentContext.TestDirectory);
            DriverService.Start();
        }
Exemple #2
0
        public void StartTest()
        {
            if (!DriverService.IsRunning)
            {
                // DriverService should be started in StartTestRun().
                throw new ApplicationException($"The DriverService '{DriverService}' is not running.");
            }

            Driver = WebDriverFactory.CreateWebDriver(BrowserSettings, DriverService);
            if (BrowserSettings.DeleteAllCookies)
            {
                Driver.Manage().Cookies.DeleteAllCookies();
            }
            SetBrowserWindow();
        }