FindElements() public méthode

Finds all elements matching the criteria.
public FindElements ( ISearchContext context ) : ReadOnlyCollection
context ISearchContext An object to use to search for the elements.
Résultat ReadOnlyCollection
Exemple #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));
        }
        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);
 }
Exemple #4
0
 public ReadOnlyCollection<IWebElement> FindElements(By mechanism)
 {
     return mechanism.FindElements(new ElementFinderContext(currentNode, webBrowser));
 }
 public static IWebElement FindFirstVisibleElement(By by)
 {
     return by.FindElements(Driver).FirstOrDefault(e => e.Displayed);
 }
 public ReadOnlyCollection<IWebElement> FindElements(By by)
 {
     return by.FindElements(this);
 }
 public ReadOnlyCollection<IWebElement> FindElements(By mechanism)
 {
     return mechanism.FindElements(new ElementFinderContext(_xElement));
 }