Overview
Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
This tutorial demonstrates how to enhance your Selenium automation framework by implementing Page Factory with the Page Object Model (POM). Learn what Page Factory is—a built-in Selenium class that efficiently initializes web elements—and how it works internally using @FindBy annotations and PageFactory.initElements(). Discover the benefits including time savings, cleaner code, easier maintenance, and improved performance. Follow a step-by-step implementation process: checking Selenium dependencies in pom.xml, updating LoginPage.java with Page Factory implementation, modifying LoginTest.java to use the updated page objects, and running tests to verify functionality. The tutorial includes practical code examples and explanations of how Page Factory improves your automation framework structure compared to traditional POM implementations.
Syllabus
00:00 We will learn:
00:43 What is Page Factory
05:50 How to Use Page Factory for Better Page Object Model POM
05:54 Step 1 - Check Selenium dependency is added in pom.xml mvn clean install
06:36 Step 2 - Update LoginPage.java to add PageFactory implementation
16:40 Step 3 - LoginTest.java will now refer elements and actions from updated LoginPage.java
17:46 Step 4 - Run and Test
Taught by
Automation Step by Step