OpenQA.Selenium.By.FindElements C# (CSharp) Method

FindElements() public method

Finds all elements matching the criteria.
public FindElements ( ISearchContext context ) : ReadOnlyCollection
context ISearchContext An object to use to search for the elements.
return ReadOnlyCollection
        public virtual ReadOnlyCollection<IWebElement> FindElements(ISearchContext context)
        {
            return this.findElementsMethod(context);
        }

Usage Example

Exemplo n.º 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));
        }
All Usage Examples Of OpenQA.Selenium.By::FindElements