RE: 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.

Add Comment
3 Answers
Best answer

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.

Train Answered on July 15, 2015.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.