Automating your application is easy on the way to reach your goal in your selenium tests. But give me answers to below questions or answer yourself. 1. Is it readable? 2. Is it easily modifiable while your script grows? 3. Is it easily identifiable? 4. Can anybody edit your locator? etc.... For all these questions, your answer might be a big NO.To solve this prob, here is the approach. Maintaining Locators: Always maintain your locators in a single file which is supported by your script driven language like below. Java --- you have .properties file Python --- Config parser or dictionaries C# --- .config file Ruby --- YAML file So maintain your locators in a single file and edit whenever you want like QTP Object Repository. Your file should contain your locators like this. PageName.ElementName=ElementLocatorString Ex: locators.properties file # Here registration is my page and firstname is element on registration page....
Sharing ideas with automation testers and Enjoying the ride...