示例#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);
        }
示例#3
0
 public IWebElement OptionalElement(Locators.By.jQueryBy jQueryFindExpression, TimeSpan maxWait = default(TimeSpan))
 {
     try
     {
         return(Element(jQueryFindExpression, maxWait));
     }
     catch (NoSuchElementException)
     {
         return(null);
     }
 }
示例#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));
        }
示例#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;
     }
 }
示例#6
0
 public IWebElement TryFindElementByjQuery(Locators.By.jQueryBy @by)
 {
     throw new NotImplementedException("Obsolete");
 }
示例#7
0
 public IWebElement Element(Locators.By.jQueryBy jQueryFindExpression, TimeSpan maxWait = default(TimeSpan))
 {
     return(Browser.ElementWithWait(d => d.FindElementByjQuery(jQueryFindExpression), maxWait));
 }