Can’t we use excel as an object repository for Selenium..?
I am curious to know that while implementing automation framework using selenium webdriver, why cant we use excel as an object repository and why everyone is using PageObject or property file to store all locators. I am thinking like if we use excel to save all element locator by pagewise then it is easy to keep all locators at one place/one excel and if required we can easily change the locators-path too.
Though i am looking for suggestion before going ahead and implementing the same and if there is any disadvantage to using excel.
Instead of using Excel you can also use Object Map. Object Maps help in making test script management much easier. In case you are using Java Properties Class can be used to access property file.
properties = new Properties()
By passing a logical name or key to the getProperty() method of the Properties class we can retrieve a value from the pair.
The getLocator() method uses the value returned by the getProperty() method.
In case if you are using Excel you need to use the Apache POI API to manipulate the Excel spreadsheet.
I am using excel as an object repository where I keep all my locators and test cases in excel.
It works well. You need to be careful while reading and writing the excel and closing the streams appropriately.
I haven’t found any disadvantage yet.