示例#1
0
        public void GoToUrl(string url)
        {
            var duration = new Stopwatch();

            duration.Start();
            try
            {
                _driver.Navigate().GoToUrl(url);
                _driver.Manage().Window.Maximize();
                _driver.Manage().Cookies.DeleteAllCookies();
                duration.Stop();
                Log.Info(MethodBase.GetCurrentMethod().Name + TestConstants.Sp + duration.ElapsedMilliseconds + TestConstants.Ms);
            }
            catch (Exception e)
            {
                Log.Error(e);
                throw new ElementNotVisibleException();
            }
        }
示例#2
0
        private static IWebDriver CreateRemoteWebDriver(ICapabilities capabilities)
        {
            var driver = new ScreenShotRemoteWebDriver(new Uri("http://hub.browserstack.com/wd/hub/"), capabilities);

            var resolution = Config.Settings.BrowserStackSettings.BsResolution;

            if (resolution == null)
            {
                driver.Manage().Window.Maximize();
            }

            driver.VaftExt().TurnOnImplicitlyWait();

            var detector = new LocalFileDetector();

            driver.FileDetector = detector;

            return(driver);
        }