Data-driven testing: CSV vs. XLSX, which is better?

791 views
Skip to first unread message

Elysia Lock

unread,
Jul 7, 2014, 5:27:05 PM7/7/14
to testng...@googlegroups.com
Hi all,

I'm new to TestNG (but not new to QA and automation, been doing it for 8 years). I recently accepted a job where our test automation is done in TestNG & Selenium. We also use Maven, but I'm not sure that matters here. :)

We recently made the move from CSV files to XLSX files for our data-driven tests. I noticed that our test times went way up. Has anybody else noticed that Excel files work much more slowly than CSV files in TestNG?

What are some other pros/cons of CSV vs. XLSX files? Which do you prefer to use, and why?

Thanks for your input! 

-E

Mrunal Gosar

unread,
Jul 9, 2014, 11:23:15 AM7/9/14
to testng...@googlegroups.com
Hi Elysia
Excel has its own advantages when it comes to automation. You can add various macros to excel which is helpful in many ways. you can store the results in excel and hence plot a graph and send it for further analysis. I know excel is heavy. But consider scenarios where your test data has characters like comma and tab where in you want to treat that data as one, but while reading because of comma you might get multiple values. Excel can be treated as data source and used in your test. The list of pros of excel is long. But to cut story short thought excel is heavy, but its advantages and power makes its cons to be overlooked.

Regards
Mrunal

Elysia Lock

unread,
Jul 11, 2014, 1:12:43 PM7/11/14
to testng...@googlegroups.com
Thank you for your input. Those are all very good points; I hadn't considered issues with escaping commas in the CSV documents. We're planning on moving to Sauce Labs, so I don't think we'll see much value from graphs.

Now to meet with my team and see if the fact that the tests take 3-4 times as long to run with XLSX files is worth the benefits.

Thanks again Mrunal!

-E

djangofan

unread,
Jul 20, 2014, 6:20:43 PM7/20/14
to testng...@googlegroups.com
I use Apache MetaModel to read info from .CSV and .XLSX .  It works really nice and is easier than using raw JXL, or similar.
https://github.com/djangofan/MetaModelExample   .   I prefer CSV though because I don't think data driving flat files should be  "multi-tabbed" . 
 
-Jon
Reply all
Reply to author
Forward
0 new messages