POM:
- Page Object is a Design Pattern which has become popular in test automation for enhancing test maintenance and reducing code duplication.
- A page object is an object-oriented class that serves as an interface to a page of your AUT. The tests then use the methods of this page object class whenever they need to interact with the UI of that page.
- The benefit is that if the UI changes for the page, the tests themselves don’t need to change, only the code within the page object needs to change. Subsequently all changes to support that new UI are located in one place.
The Page Object Design Pattern provides the following advantages
- There is a clean separation between test code and page specific code such as locators (or their use if you’re using a UI Map) and layout.
- There is a single repository for the services or operations offered by the page rather than having these services scattered throughout the tests.
ARCHITECTURE:
![]() |
[Figure 1: POM with Page Factory Architecture]
|
To create the Selenium Page Object Model framework using page factory, selenium web driver & test ng follow the Step by Step guide in Next post.
Very nice initiative swaraj. Well done.
ReplyDeleteVery nice article Swaraj, keep it up!
ReplyDelete