Initializes a new instance of the By class using the given functions to find elements.
Namespace: OpenQA.Selenium
Assembly: WebDriver (in WebDriver.dll) Version: 3.1.0
Syntax
protected By( Func<ISearchContext, IWebElement> findElementMethod, Func<ISearchContext, ReadOnlyCollection<IWebElement>> findElementsMethod )
Parameters
- findElementMethod
- Type: SystemFuncISearchContext, IWebElement
A function that takes an object implementing ISearchContext and returns the found IWebElement. - findElementsMethod
- Type: SystemFuncISearchContext, ReadOnlyCollectionIWebElement
A function that takes an object implementing ISearchContext and returns a ReadOnlyCollectionT of the foundIWebElements. IWebElements/>.
See Also