Storing test data in Excel/CSV vs DB

1.6k views Asked by At

I would request for some help on test automation data storage and retrieval. We are writing test automation scripts with Selenium Webdriver. We started off with using MS Excel sheets to store our test data and using Apache POI to read the data. What we observed recently is sometimes when multiple people modify the same sheet and checkin into GIT, the changes are not reflected. One automation engineer proposed using .csv file to avoid this problem and I proposed using a Oracle database to store test data.

Is it a good idea to store test data in different Oracle DB tables? My idea is to create oracle tables with two columns that store name/value pairs. My application is large and might require anywhere between 5 to 10 tables.

Kindly let me know.

Regards Srinivas

1

There are 1 answers

0
Piotr Lewandowski On BEST ANSWER

I believe, for most of the cases CSV would be good enough. Creating special database (especially for storing only key/pair values) for test data seems like overkill.


CSV pros

  • Advantages of using GIT (easy diffs, history of changes)
  • Performance: It's plain text file, easy to read
  • Disk space
  • Support of parameterized tests (Junit, TestNG)

CSV cons

  • Maintain relations between different data if such exists

Database pros

  • Flexibility
  • Easier mapping complicated objects with relations

Database cons

  • Time for building initial setup and maintaining it
  • Performance: Starting, cleaning-up and initializing DB (to keep repeatability of tests)
  • Preferably you should test also database that you're using

Main problem with using database is maintaining tests code, which should be simple, fast and repeatable.