UI Map / Object Repository
UIMap is a concept for defining, storing, and serving UI elements of an application or a website. The UIMap properties file contains a set of ‘key-value’ pairs, where key is an alias of the UI element, and a value is the locator.
We will create properties file for every single page and capture all the UI elements present on the page and use it as per needs.
UI Map or Object Repository Samples: -
Role - System Admin
Why and How to use UI Map / Object Repository / OR
To perform any action we need locators. Tool will perform any action based on the locators. For each and every action tool depends on these locators. If the tool does not identify the locators, it simply throws an error as Locator / Element Not Found or Identified.
In order to make sure the tool executes smoothly, we need to provide accurate unique identifier / locators.
We need to keep all the locators at one place where we can easily modify the locators / identifies if there are any UI changes in the application.
If not, it will become difficult to change even one locator, as it will be used at many different places in test scripts.
It is always better to keep locators in a separate file and at easily accessible location. It should be defined in such a way if any new person joins in the middle of the project, he/she should be capable of making changes / adding any new locators to the file.
In the above example, we have created properties file for each function which will store all the UI elements.
Example: In Manage Users, we will store all the locators’ / UI elements information which can be used and accessed in “Add Users”, “Edit Users” and “Delete Users” test cases