This guide is the first of a series of guides, for web and mobile applications, that take you through an empty MobileCloud project and continue all the way through to building a complete testing framework.
Design pattern concept
The main idea behind the Page Object Model (POM) design pattern, is to create an Object Repository for the pages in our application/website, which we will then used in the tests. In other words, instead of including the page elements and the test code together within the test, we separate them into 2 different entities: the pages and the test flows. Using this concept, each page in the application will have a corresponding page class. The page classes will identify the elements in the page and contain methods that perform operations on these page elements.
- Maintainable and Reliable
- POM design pattern uses class hierarchy for common components
- Each element in the entire application/website is mapped exactly once
- Reduces code and code duplication
- UI change fixes done in one place
- Readable, Modular and clear
- Strict separation between test flows and app views, allows to create any test flow with the existing repository
- Any change in the app causes a change only in one place (repository)
- POM repository is not framework dependent
* Continue to the next posts in this series to see a complete example with code snippets.