{"id":2135,"date":"2023-04-03T10:43:50","date_gmt":"2023-04-03T10:43:50","guid":{"rendered":"https:\/\/automationqahub.com\/?p=2135"},"modified":"2024-04-08T11:49:15","modified_gmt":"2024-04-08T11:49:15","slug":"how-to-maintain-the-object-repository-in-selenium","status":"publish","type":"post","link":"https:\/\/automationqahub.com\/how-to-maintain-the-object-repository-in-selenium\/","title":{"rendered":"How To Maintain The Object Repository In Selenium"},"content":{"rendered":"\n
An Object Repository is a central location that is used to keep the locators in the form of objects. The Major advantages of maintaining an object repository are readability, maintainability and reusability. In this article, we will discuss several approaches to maintaining the object repository in Selenium.<\/p>\n\n\n\n
Page object Model or POM is a trendy approach in the Selenium framework where an Object repository is maintained in the form of page classes but in this article, we will see different approaches.<\/p>\n\n\n\n
1)Object Repository using a properties file.<\/p>\n\n\n\n
2)Object Repository using YAML file.<\/p>\n\n\n\n
3)Object Repository using XML file.<\/p>\n\n\n\n
Data is stored in properties files in the form of key-value pairs.<\/p>\n\n\n\n
1)To start with create a properties file by right click -> new -> file
2)Give it a name for example locators.properties<\/strong>
3)Open properties files and store locators in the form of keys and values.<\/p>\n\n\n\n