When to Use Page Object Model, Advantages and disadvantages of POM - Bug Reaper

                  Bug Reaper

Lean about Automation Testing,Selenium WebDriver,RestAssured,Appium,Jenkins,JAVA,API Automation,TestNG,Maven, Rest API, SOAP API,Linux,Maven,Security Testing,Interview Questions

Thursday 29 January 2015

When to Use Page Object Model, Advantages and disadvantages of POM

Page Objects Model is best suited for applications which have multiple pages or states. Each of which have fields which can be uniquely referenced with respect to the page.
Advantages:
  1. Object Repository: You can create an Object Repository of the fields segmented page-wise. This as a result provides a Page Repository of the application as well. Each page will be defined as a java class. All the fields in the page will be defined in an interface as members. The class will then implement the interface.
  2. Functional Encapsulation: All possible functionality or operations that can be performed on a page can be defined and contained within the same class created for each page. This allows for clear definition and scope of each page's functionality.
  3. Low maintenance: Any User Interface changes can swiftly be implemented into the interface as well as class.
  4. Programmer Friendly: Robust and more readable. The Object-oriented approach makes the framework programmer friendly.
  5. Low Redundancy: Helps reduce duplication of code. If the architecture is correctly and sufficiently defined, the POM gets more done in less code.
  6. Efficient & Scalable: Faster than other keyword-driven/data-driven approaches where Excel sheets are to be read/written.
Disadvantages
  1. High Setup Time & Effort: Initial effort investment in development of Automation Framework is high. This is the biggest weight of POM in case of web applications with hundreds/thousands of pages. It is highly suggested that if this model is decided to be implemented, then it should be done parallel to development of the application. Refer V-Model for Software Development Life Cycle.
  2. Skilled labor: Testers not technically sound or aware of programming best practices are a nightmare in this case. Perhaps this is the biggest mistake to make, employing unskilled labor in hopes of training them during implementation. Unskilled testers need to undergo a Training Boot Camp to be ready for such an undertaking. Also the Architecture of the framework should be defined clearly and completely before development in order to avoid any loopholes in later stages. Every application is different and it may require the automation framework to be significantly tailored towards it.
  3. Specific: Not a generic model. Automation Framework developed using POM approach is specific to the application. Unlike keyword-driven/data-driven frameworks, it is not a generic framework.
Irrespective of the disadvantages, POM is perhaps the most efficient and highly recommended approach towards any web application. As the framework matures it is perhaps easier to modify it into a hybrid framework from a POM approach than from other keyword/data driven approaches.

2 comments:

  1. [Page Objects Model is most appropriate for applications which have different pages or states. Every one of which have fields which can be remarkably referenced concerning the page.
    DTI

    ReplyDelete
  2. Page Objects Model is most appropriate for applications which have different pages or states. Every one of which have fields which can be remarkably referenced concerning the page.

    Regards
    Ali kazmi

    ReplyDelete