Exemple #1
0
        public string WaitForVisibilityOfURL(string url)
        {
            try
            {
                WebDriverWait wait       = new WebDriverWait(driver, TimeSpan.FromSeconds(GetWaitTimeoutSeconds()));
                string        actual_url = wait.Until(CustomExpectedConditions.urlContainedBy(url));

                string info = string.Format("Wait for URL [{0}] displays", url);
                NLogger.Info(info);
                HtmlReporter.Pass(info);

                return(actual_url);
            }
            catch (WebDriverTimeoutException ex)
            {
                var    message    = string.Format("The URL [{0}] is not presented as expected", url);
                string screenshot = ScreenShotCapturing.TakeScreenShoot(driver, message);
                HtmlReporter.Fail(message, ex, screenshot);
                throw new ErrorHandler(message, ex);
            }
        }