/Meet-me-In-the-Middle

Modifying page object model methodology to achieve better maintenance and easy scalability for large scale applications.

MIT LicenseMIT

Meet me In the Middle (MIM)

Here we put together some guidelines on how to use page object model for large scale complex projects. We have modified page object model methodology to achieve better maintenance and easy scalability for large scale applications.

Guidelines to design large scale automation with advanced page object model pattern

This methodology will provide following benifits:

  • Provide better interface to interact with the page DOM objects.
  • Breakdown complex page classes in to small manageable sections.

Consider following set of guidelines when designing large scale automation project:

1. Keep the web page classes in the same hierarchy as in the application.

  • To make the pages easy to locate put the pages in the same hierarchy as in we find in the application UI.

Here is the example: Robotize Facebook Create New Listings page

As shown in the folder heirarchy the Create New Listing goes under the Marketplace.

image

2. Each application page should be divided into manageable sections, such as header, left menu, main section etc.

Often pages can be simple as user login page or complex as Facebook homepage. When developing project from scratch or updating an existing one, try to see the big picture and understand how entire application designed to better breakdown each page into a manageable sections.

Here is the example: Robotize Facebook watch page is divided in to three sections.

  • Header
  • Menu Items
  • Feed

image

3. One-to-One mapping between application page and automation page (Code).

  • Each DOM Element in the application page should correspond to only one DOM property in automation code library.
  • We cannot emphasise enough to ensure there should be only one xpath for a given DOM object.

Here is the example: Robotize Facebook Home page

image

4. All DOM elements of the page should be implemented as properties of the UI page.

  • A button/textbox etc should be implemented as a property. In order to click on it, when writing test the user can easily access all the available properties of the DOM object and perform necessary action. By returning the DOM element as a property instead of providing specific operation, will provide more options when we start writing the test.

Here is the example: Robotize Facebook All the DOM objects available on the Facebook Home page are provided as property.

image

Following projects are developed using AdvancedPOM: