The POM for UI automation
The POM is one of the best-known design patterns for writing test frameworks. It consists of separating the model (or test logic) from the pages (the declaration of objects and the locators of elements that those tests interact with). This allows the developer of the test code to find those objects and locators in an effortless way, rather than having to search all the instances of such objects across all the lines of code. The longest the test code, the more tedious this task becomes.
This model creates scalable and maintainable programs that can easily be changed if needed. While this is a good practice for any type of code (and could be considered part of the don’t repeat yourself (DRY) principle), it is especially critical for frontend test code, as the definition of locators and elements tends to change frequently.
Note
DRY’s goal is to reduce the redundancy and repetition of software patterns, replacing them with abstraction or...