OpenQA.Selenium.By.FindElement C# (CSharp) Méthode

FindElement() public méthode

Finds the first element matching the criteria.
public FindElement ( ISearchContext context ) : IWebElement
context ISearchContext An object to use to search for the elements.
Résultat IWebElement
        public virtual IWebElement FindElement(ISearchContext context)
        {
            return this.findElementMethod(context);
        }

Usage Example

Exemple #1
0
        /// <summary>
        /// Finds the first element in the page that matches the <see cref="By"/> object
        /// </summary>
        /// <param name="by">By mechanism to find the object</param>
        /// <returns>IWebElement object so that you can interact with that object</returns>
        /// <example>
        /// <code>
        /// IWebDriver driver = new InternetExplorerDriver();
        /// IWebElement elem = driver.FindElement(By.Name("q"));
        /// </code>
        /// </example>
        public IWebElement FindElement(By by)
        {
            if (by == null)
            {
                throw new ArgumentNullException("by", "by cannot be null");
            }

            return(by.FindElement(this));
        }
All Usage Examples Of OpenQA.Selenium.By::FindElement