Beispiel #1
0
        // todo: unit/integration test this
        public IWebElement ActionOnLocator(Locators.By.jQueryBy jQueryFindExpression, Action <IWebElement> action, TimeSpan maxWait = default(TimeSpan))
        {
            var element = _finder.Element(jQueryFindExpression, maxWait);

            action(element);
            return(element);
        }
        public static IWebElement PerformActionOn(this IWebDriver browser, Locators.By.jQueryBy by, Action <IWebElement> actionToPerform)
        {
            var element = browser.FindElementByjQuery(@by);

            actionToPerform(element);

            return(element);
        }
Beispiel #3
0
 public IWebElement OptionalElement(Locators.By.jQueryBy jQueryFindExpression, TimeSpan maxWait = default(TimeSpan))
 {
     try
     {
         return(Element(jQueryFindExpression, maxWait));
     }
     catch (NoSuchElementException)
     {
         return(null);
     }
 }
Beispiel #4
0
        public IEnumerable <IWebElement> Elements(Locators.By.jQueryBy jQueryFindExpression, TimeSpan maxWait = new TimeSpan())
        {
            var atLeastOneElement = OptionalElement(jQueryFindExpression, maxWait);

            if (atLeastOneElement == null)
            {
                return(Enumerable.Empty <IWebElement>());
            }

            return(Browser.FindElements(jQueryFindExpression));
        }
Beispiel #5
0
 // todo: unit/integration test this
 public IWebElement ActionOnLocator(Locators.By.jQueryBy jQueryFindExpression, Action <IWebElement> action, TimeSpan maxWait = default(TimeSpan))
 {
     try
     {
         var element = _finder.Element(jQueryFindExpression, maxWait);
         action(element);
         return(element);
     }
     catch (Exception)
     {
         _camera.TakeScreenshot();
         throw;
     }
 }
Beispiel #6
0
 public IWebElement TryFindElementByjQuery(Locators.By.jQueryBy @by)
 {
     throw new NotImplementedException("Obsolete");
 }
Beispiel #7
0
 public IWebElement Element(Locators.By.jQueryBy jQueryFindExpression, TimeSpan maxWait = default(TimeSpan))
 {
     return(Browser.ElementWithWait(d => d.FindElementByjQuery(jQueryFindExpression), maxWait));
 }