FindElements() 공개 메소드

Finds all elements matching the criteria.
public FindElements ( ISearchContext context ) : ReadOnlyCollection
context ISearchContext An object to use to search for the elements.
리턴 ReadOnlyCollection
예제 #1
0
        /// <summary>
        /// Finds all <see cref="IWebElement">IWebElements</see> within the current context
        /// using the given mechanism.
        /// </summary>
        /// <param name="by">The locating mechanism to use.</param>
        /// <returns>A <see cref="ReadOnlyCollection{T}"/> of all <see cref="IWebElement">WebElements</see>
        /// matching the current criteria, or an empty list if nothing matches.</returns>
        public virtual ReadOnlyCollection <IWebElement> FindElements(By by)
        {
            if (by == null)
            {
                throw new ArgumentNullException(nameof(@by), "by cannot be null");
            }

            return(by.FindElements(this));
        }
예제 #2
0
        public static void AssertAllTextsAreEqual(string expectedText, By by)
        {
            StepHelper.Attempt(() =>
            {
                var elements = by.FindElements(Driver);

                foreach (var e in elements)
                {
                    Assert.AreEqual(expectedText, e.Text);
                }

                return true;
            });
        }
 public ReadOnlyCollection<IWebElement> FindElements(By by)
 {
     ISearchContext ctx = CreateSearchContext(_my);
     return by.FindElements(ctx);
 }
예제 #4
0
 public ReadOnlyCollection<IWebElement> FindElements(By mechanism)
 {
     return mechanism.FindElements(new ElementFinderContext(currentNode, webBrowser));
 }
예제 #5
0
 public static IWebElement FindFirstVisibleElement(By by)
 {
     return by.FindElements(Driver).FirstOrDefault(e => e.Displayed);
 }
예제 #6
0
 public ReadOnlyCollection<IWebElement> FindElements(By by)
 {
     return by.FindElements(this);
 }
예제 #7
0
 public ReadOnlyCollection<IWebElement> FindElements(By mechanism)
 {
     return mechanism.FindElements(new ElementFinderContext(_xElement));
 }