From the course: Advanced Selenium: Support Classes
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
What is PageFactory? - Selenium Tutorial
From the course: Advanced Selenium: Support Classes
What is PageFactory?
- [Instructor] Page objects can be simple Java objects. But web driver comes with the page factory, and a set of annotations to help people get started with page objects. Here, I have a test called page factory test. And this is a page object called support classes page shown on line 30. And this page object is exposing fields single resend button and message as public fields so that I can use them in the test. And on line 32 and line 35. So I'm going to have a quick look at the page object and see how it is implemented. So I will use Command click or control click on Windows to go through another source code. In here we have the support classes page. The support classes page object on line 13 extends page factory, which is a class from the web driver support classes and allows us to use annotations to build up a set of web elements, which can make it faster to create initial page objects. Extending the page factory…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.