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
ManageUsers.Properties
ManageDepartments.Properties
ManageLocations.Properties
Example:-
ManageUsers.Properties
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
Comments
Query
Is there any perticular format in TestNG to store IDs/Locators? If not, Can i store it in text file and write a code to identify the keyword and return a value of that keyword?
You can store locators in
You can store locators in text file (properties file) and read them.
Please refer the below link for reading data from properties file
http://seleniumeasy.com/selenium-tutorials/read-data-from-properties-fil...
Regarding UI Mapping in web pages
Can i know how to get UI actions in dynamic web pages i.e in all the web pages
Junit
The topics are really nice.Thank you.Please add some examples regarding the annotations and some other uses of JUnit framework
Request
Hi I am rose. I am new to the selenium tool. I am facing a problem in reading a excel data to webpage; means sending a data through a excel sheet to fill a form. please help me to sort out
This post is very helpful.
This post is very helpful. Thanks for sharing.
Help me to handle captcha in selenium
Hi Everyone
Please help me how to handle captcha in selenium
captcha
unfortunately captcha functionality cannot be handled by selenium webdriver
Very helpfull
Thanks
Useful information
Nice content ....I am new to selenium and want to design framework for my project.... this is really going to help me how frameworks need to be developed...
Add new comment