Page Object Model -- Another important point to be considered while building the framework.
We many not give much of an importance while developing initially while automating the smaller application, but as the automation coverage grows, Page object model plays an important role.
Below is the presentation on POM that I had covered recently, and the topics covered include
- What is POM?
- Why POM?
- Page Libraries
- Syntax
- Code
- Page Factory
- Annotation
Here are few reasons why to consider using POM.
- Page Object Model is an Object repository design pattern in Selenium WebDriver.
- POM creates our testing code maintainable, reusable.
- Operations and flows in the UI should be separated from verification which makes our code cleaner and easy to understand.
- Object repository should be independent of test cases, use the same object repository for a different purpose with different tools.
- Example: we can integrate POM with TestNG/JUnit for functional testing and at the same time with JBehave/Cucumber for acceptance testing.
- Code becomes less and optimized because of the reusable page methods in the POM classes.
- Methods get more realistic names which can be easily mapped with the operation happening in UI. i.e. if after clicking on the button we land on the Travel, the method name will be like 'gotoTravel ()‘
- Page Factory is an optimized way to create object repository in POM concept.
No comments:
Post a Comment