Inheritance: Selenium.List, ComInterfaces._WebElements
Esempio n. 1
0
        private WebElements FindAnyElements(By byAny, int minimum, int timeout)
        {
            RemoteSession session     = this.session;
            string        uri         = this.uri + "/elements";
            WebElements   webelements = new WebElements();
            DateTime      endTime     = session.GetEndTime(timeout);

            while (true)
            {
                foreach (By by in (By[])byAny.Value)
                {
                    if (by == null)
                    {
                        break;
                    }
                    var  method   = By.FormatStrategy(by.Strategy);
                    var  value    = (string)by.Value;
                    List elements = (List)session.Send(RequestMethod.POST, uri, "using", method, "value", value);
                    webelements.Add(session, elements);
                }
                if (webelements.Count >= minimum)
                {
                    return(webelements);
                }
                if (DateTime.UtcNow > endTime)
                {
                    throw new Errors.NoSuchElementError(byAny);
                }
                SysWaiter.Wait();
            }
        }
Esempio n. 2
0
 private WebElements FindAnyElements(By byAny, int minimum, int timeout) {
     RemoteSession session = this.session;
     string uri = this.uri + "/elements";
     WebElements webelements = new WebElements();
     DateTime endTime = session.GetEndTime(timeout);
     while (true) {
         foreach (By by in (By[])byAny.Value) {
             if (by == null)
                 break;
             var method = By.FormatStrategy(by.Strategy);
             var value = (string)by.Value;
             List elements = (List)session.Send(RequestMethod.POST, uri, "using", method, "value", value);
             webelements.Add(session, elements);
         }
         if (webelements.Count >= minimum)
             return webelements;
         if (DateTime.UtcNow > endTime)
             throw new Errors.NoSuchElementError(byAny);
         SysWaiter.Wait();
     }
 }