public IWebElement ActionOnLocator(By findExpression, Action <IWebElement> action, TimeSpan maxWait = default(TimeSpan))
        {
            var element = _finder.Element(findExpression, maxWait);

            action(element);
            return(element);
        }
Beispiel #2
0
 public IWebElement ActionOnLocator(By findExpression, Action <IWebElement> action, TimeSpan maxWait = default(TimeSpan))
 {
     try
     {
         var element = _finder.Element(findExpression, maxWait);
         action(element);
         return(element);
     }
     catch (Exception)
     {
         _camera.TakeScreenshot();
         throw;
     }
 }
Beispiel #3
0
        public IWebElement ElementFor <TField>(Expression <Func <TViewModel, TField> > propertySelector, TimeSpan maxWait = default(TimeSpan))
        {
            var name = ExpressionHelper.GetExpressionText(propertySelector);
            var id   = TagBuilder.CreateSanitizedId(name);

            return(_elementFinder.Element(By.Id(id), maxWait));
        }
Beispiel #4
0
        internal static TPage Navigate <TPage>(this IElementFinder finder, IPageNavigator navigator, IWebDriver browser, By by, int waitTimeout = 10)
            where TPage : UiComponent, new()
        {
            var element    = finder.Element(by);
            var resultPage = navigator.To <TPage>(by);

            return(resultPage);
        }
Beispiel #5
0
        public void ClearAndSendKeys(string elementName, string value, bool clearFirst = true)
        {
            var element = _elementFinder.Element(By.Name(elementName));

            if (clearFirst)
            {
                element.Clear();
            }
            element.SendKeys(value);
        }
Beispiel #6
0
        internal static TPage NavigateAndWaitForStalenessTo <TPage>(this IElementFinder finder, IPageNavigator navigator, IWebDriver browser, By by, int waitTimeout = 10)
            where TPage : UiComponent, new()
        {
            var element    = finder.Element(by);
            var resultPage = navigator.To <TPage>(by);
            var wait       = new WebDriverWait(browser, TimeSpan.FromSeconds(waitTimeout));

            wait.Until(ExpectedConditions.StalenessOf(element));

            return(resultPage);
        }
 public IWebElement Element(By findExpression, TimeSpan maxWait = default(TimeSpan))
 {
     ExplicitCheckForPageReady(findExpression);
     return(find.Element(findExpression, maxWait).ScrollToElement(execute));
 }
Beispiel #8
0
 public static SelectElement DropDown(this IElementFinder finder, By.jQueryBy by,
                                      TimeSpan maxWait = default(TimeSpan))
 {
     return(new SelectElement(finder.Element(@by, maxWait)));
 }