상속: Selenium.List, ComInterfaces._WebElements
예제 #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();
            }
        }
예제 #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();
     }
 }