Page Object model (POM)
- POM is a design pattern for creating an Object Repository of UI webElements.
- Each web page in the application is required to have it’s own corresponding Page Class.
- The Page Class is responsible for finding WebElements in that page and performing operations on those WebElements.
Page Object Model Design Pattern is an elegant way of implementing test routines that are:
- reduce code duplication
- easy to maintain and extend in the future.
Page object model (POM) can be used in any kind of
framework such as modular, data-driven, keyword driven, hybrid
is an object-oriented class that serves as an interface to a
page of Application Under Test(AUT).
POM essentially models the pages/screen of the application as objects called Page Objects.
- Each page will be defined as a java class.
- All the fields in the page will be defined in an
interface as members.
- The class will then implement the interface.
- are represented as classes,
- and various page elements are defined as
variables in the class.
Variables = references to web page elements
- Methods implement behaviors.
All the functions that can be performed in the specific page are encapsulated in the page object of that screen.
In this way any change made in the UI will only affect that screens page object class thus abstracting the changes from the test classes.
use Page Object Class methods
to interact with the User Interface (UI) of a web page.
If page UI changes, the tests themselves don’t need to change,
only the code within the page object needs to change.
Subsequently, all changes to support new UI are located in
A single place.
Read more about POM Design Pattern on SeleniumHQ Official Site >>>