Table of Contents

Interface ISearchContext

Namespace
OpenQA.Selenium
Assembly
WebDriver.dll

Defines the interface used to search for elements.

public interface ISearchContext

Methods

FindElement(By)

Finds the first IWebElement using the given method.

IWebElement FindElement(By by)

Parameters

by By

The locating mechanism to use.

Returns

IWebElement

The first matching IWebElement on the current context.

Exceptions

ArgumentNullException

If by is null.

NoSuchElementException

If no element matches the criteria.

FindElements(By)

Finds all IWebElements within the current context using the given mechanism.

ReadOnlyCollection<IWebElement> FindElements(By by)

Parameters

by By

The locating mechanism to use.

Returns

ReadOnlyCollection<IWebElement>

A ReadOnlyCollection<T> of all WebElements matching the current criteria, or an empty list if nothing matches.