Member-only story

Functional vs Structural Page Object Model

Japneet Sachdeva
3 min readOct 21, 2024

--

Page Object Model is the most widely used design pattern and implemented for creating robust test automation frameworks. In short we usually describe it as POM (I will be doing the same in rest of the blog). Major advantages of using POM are:

  1. Reusability: because it implements Encapsulation
  2. Easy Maintenance: because each web page has its own class or for its component
  3. Better Readability: Page object methods should follow easy to read naming conventions, which displays the use and functionality of it.
  4. Abstraction: As per the usage, we can create as many abstract layers within the framework. This reduces code complexity and promotes data hiding.
  5. Easy Debugging: Global configurations, constants, reporting, logging are all maintained separately which reduces time spent on debugging.

Let’s quickly understand how POM works:

  1. Update your POM.XML file with below dependencies:
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.5.0</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>…

--

--

Japneet Sachdeva
Japneet Sachdeva

No responses yet