What Is initElements

The initElements is a static method of PageFactory class which is used to initialize all the web elements located by @FindBy annotation. Thus, instantiating the Page classes easily.

What does PageFactory initElements driver this ); mean?

PageFactory. initElements() static method takes the driver instance of the given class and the class type, and returns a Page Object with its fields fully initialized.

What is difference between POM and page factory?

S.No.POMPageFactory4.’By’ annotation is used to define page objects.It uses annotation ‘FindBy’ to describe page objects.

David Miller

David Miller

Executive Financial & Market Analyst

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.

Share this article
Twitter Facebook Pinterest