PageFactoryInitElements Method (Object, IElementLocator, IPageObjectMemberDecorator)WebDriver
Initializes the elements in the Page Object.

Namespace: OpenQA.Selenium.Support.PageObjects
Assembly: WebDriver.Support (in WebDriver.Support.dll) Version: 3.1.0
Syntax

public static void InitElements(
	Object page,
	IElementLocator locator,
	IPageObjectMemberDecorator decorator
)

Parameters

page
Type: SystemObject
The Page Object to be populated with elements.
locator
Type: OpenQA.Selenium.Support.PageObjectsIElementLocator
The IElementLocator implementation that determines how elements are located.
decorator
Type: OpenQA.Selenium.Support.PageObjectsIPageObjectMemberDecorator
The IPageObjectMemberDecorator implementation that determines how Page Object members representing elements are discovered and populated.
Exceptions

ExceptionCondition
ArgumentException thrown if a field or property decorated with the FindsByAttribute is not of type IWebElement or IList{IWebElement}.
See Also

Reference