#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →

Page Object Model (POM) Design Pattern

What Is the Page Object Model?

Page Object Model (POM) is a design pattern where each web page (or component) is represented as a class containing its locators and the actions a user can perform on it, separating page structure from test logic.

Why POM Improves Maintainability

Without POM, locators are scattered across every test file, so a single UI change can require editing dozens of tests. With POM, that same change only requires updating one page object class.

Anatomy of a Page Object

PartPurpose
LocatorsStore element references for that page, defined once
Action MethodsExpose high-level actions like login() or addToCart()
Verification MethodsProvide reusable ways to check page state or results

A Simple POM Example Flow

A LoginPage class might expose a login(username, password) method internally handling locating and filling both fields and clicking submit - so tests simply call loginPage.login(user, pass) instead of repeating raw Selenium commands.

With a clean page structure via POM, the next step is making those tests reusable across many inputs through data-driven testing.

Ready to master Selenium Training Course?

Join Uncodemy's hands-on training and build real automation skills with expert mentors.

Explore Course