POM is a design pattern where each page in your application gets its own Java class. That class contains all the locators for that page and methods representing what a user can do on that page. Test classes call page object methods instead of using findElement directly. If a locator changes, you update ONE file.
Think of a page object as a contract between the page and the tests. The test says "log me in" and the page object handles how. If the login form changes from two fields to a single-sign-on button, only the page object changes. All 50 tests remain the same.
Q: What is the Page Object Model?
A: POM is a design pattern where each web page is represented by a separate Java class. The class contains element locators as private fields and user actions as public methods. Tests interact with the page through these methods instead of using findElement directly. This separates test logic from page interaction logic. When a locator changes, I update one page class instead of every test. POM improves maintainability, readability, and reusability.
Key Point: POM = one Java class per page. Locators are private, actions are public. Tests call methods, not findElement.