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 Answer(s)
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.

SD Train Answered on July 15, 2015.
Add Comment

Hi Ajay,
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.


Ashwin Karangutkar

Ashwin Train Answered on July 14, 2015.
Add Comment

Thanks Ashwin and SD for your reply, it really helps me.

ajaypande1 Default Answered on July 15, 2015.

 You are welcome ajaypande1 

on July 15, 2015.
Add Comment

Your Answer

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