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.
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.
- 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
.
2. Each application page should be divided into manageable sections, such as header, left menu, main section etc.
Here is the example: Robotize Facebook watch page is divided in to three sections.
- Header
- Menu Items
- Feed
- 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
- 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.
Following projects are developed using AdvancedPOM: