Disadvantages of the page object model in selenium

Are there any downsides to using pages for Selenium tests?

+3


source to share


1 answer


The page object model is best suited for applications with multiple pages or states. Each of which has fields that can be uniquely referenced to the page.

<strong> Benefits:

  • Object repository . You can create a repository of page-segmented field objects. It also provides a repository of application pages. Each page will be defined as a java. All fields on the page will be defined as members in the interface. The class then implements the interface.

  • Functional encapsulation . All possible functionality or operations that can be performed on a page can be defined and contained in the same class generated for each page. This allows for a clear definition and scope of each page function.

  • Low service . Any changes to the user interface can be quickly implemented both in the interface and in the class.

  • Friendly programmer . Reliable and readable. The object-oriented approach makes the framework programmer friendly.

  • Low redundancy . Helps reduce code duplication. If the architecture is correct and well defined, more POM is done in less code.

  • Efficient and scalable . Faster than other key / data based approaches when reading / writing Excel sheets.



disadvantages

  • Time and effort of high customization . The initial investment in the development of the Automation Framework is high. This is the largest POM weight in the case of web applications with hundreds / thousands of pages. It is strongly suggested that if this model is to be implemented then it should be done in parallel with the development of the application. Refer the V-Model to the Software Development Lifecycle.

  • Skilled labor . Testers who don't technically sound or know about coding best practices are a nightmare in this case. This is perhaps the biggest mistake to make when using unskilled labor in the hope of training them during implementation. Unqualified testers should go through training camp to prepare for such an undertaking. Also, the architecture of the structure should be clearly and fully defined prior to development in order to avoid any loopholes in later stages. Each application is different and may require automation frameworks to be significantly adapted to it.

  • Specific : not a generic model. An automation framework developed using the POM approach is application specific. Unlike keyword / data driven frameworks, this is not a generic structure.

Regardless of the flaws, POM is perhaps the most effective and highly recommended approach for any web application. As the structure matures, it may be easier to change it to a hybrid structure from the POM approach than from other keyword / data based approaches.

+13


source







All Articles