Page object model is a design pattern used in test automation where test script and locators are defined in separate classes. In this design pattern each web page( screen in case of mobile application) is represented as a class and each element on the page is represented as an object. All the locators of the web page and actions on those locators are defined on the corresponding page created in the test automation.
Advantages of POM:
Advantages of POM:
- Maintainability: Modification in the UI pages often happens and so there are chances that test cases may fail due to locator change. So it’s easy to update the locator at one place and thus fixing the test cases failing due to locator change
- Reusability : Having locators at one place, It becomes easy to reuse throughout the test framework wherever it’s required. We need not define it in each test class.
- Readability: With the locator defined in other class using POM, it gives clear and readable code at the test layer making it more clean