Page Object Model (POM)

From GM-RKB
Jump to navigation Jump to search

A Page Object Model (POM) is a design pattern for test automation.



References

2021

  • https://medium.com/tech-tajawal/page-object-model-pom-design-pattern-f9588630800b
    • QUOTE: ... Page Object Model 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 be changed, only the code within the page object needs to change.

      Subsequently all changes to support that new UI are located in one place.

    • Why we need POM?

      Increasing automation test coverage can result in unmaintainable project structure, if locators are not managed in right way. This can happen due to duplication of code or mainly due to duplicated usage of locators.

      For Example, in home page of web application we have menu bar which leads to different modules with different features.

2019

2018