Pros and Cons of Storing Test Data in a Database VS. Excel

Hello,

I am fairly new to Katalon. I was hoping someone could help determine how test data should be stored for because there is very little information elsewhere.

I know there are 4 different data types for storing test data: Internal datafile, CSV, Excel, and External Database. After some investigating, Excel and the External Database appear to have the most functionality.

However, without access to an external database I cannot test that method.

Would an external database only be needed if I have a giant amount of test data?

Could someone help provide some insight into which method is better, or the pros and cons of both?

Thank you.

@ganish.toolsie I personally feel having an external database would be much more easier for you to read and write. Spinning up a database on AWS wouldn’t cost much. I am not a fan of internal datafiles as writing to them is really difficult. Excel is also a good approach and there are free plugins available that can make reading writing easier to excel.

you can spin-up a mysql database in just one command, on your local machine. read about docker. it works on windows too, not only on linux.
just saying …

Thanks Manpreet! Agreed, the internal datafiles are just… terrible. Do you see any benefit of using a database over Excel?

Sadlly, I don’t think I have access to do something like that, but I can check. Thanks Ibus!

hi,

Postgres database

https://www.postgresql.org

every test automation engineers should know how the postgres will work :slight_smile:

Use databases. Use Excel.
Use data classes.
Less moving parts.

provided you will figure out how to install docker, once this is done just follow the link:

https://hub.docker.com/_/mysql

there are already prepared images for postgres too. or whatever opensource toys you need. simply use them, once done, destroy the container

one day i will write a demo on using sqlite with katalon …
but not yet :stuck_out_tongue:

I think you’ve used up all your “one days”… :rofl:

1 Like

Hi Russ,

Could you expand on how I would do this?

Let’s say I make a Vehicle data class which contains all of the information about a car and I have 10 tests that all need different cars. How would I use this class with different data? Create a new vehicle at the beginning of every test case and then destroy it? Or should I make the Vehicle a singleton object and set it at the beginning of each test?

If I use data classes, what would you suggest?

If I answer that properly, it’ll be a long LONG answer.

If I answer it briefly, it will invite a lot more questions. But, that’s all I have time for… so here goes:

Your question (main topic up top) is asking about or pointing to testing philosophy. We (all of us) are performing automation testing. In my opinion, automation is about testing an app “like a user” - you’re teaching a robot (Katalon) to behave like a user would.

Users do not have a head full of data they want to bombard an AUT with. (Bombarding an app with a ton of data looking for border conditions, failovers, blah blah blah, is better suited to unit testing).

So, stated extremely briefly, I would advocate keeping your data in or very close to your tests. That’s it, in a nutshell.

How to implement that is down to you. I use data classes (in Katalon, classes are created using Custom Keywords). My data classes are only used where I need “many rows” of values to throw at a grid <- those are few though… because 0% of our users use our app like that! It would be crazy for me to do that in some external app (e.g. Excel).

That (my philosophy) may not suit you, though.

As to your cars example - doesn’t matter what the target is (cars, invoices, nuclear reactors, sausages). You have a bunch of fields and you need to throw data at them. Use what fits your needs. Don’t blindly follow my example here - trust your intuition and ask yourself, “can a user do this? No? Why am I teaching a robot to do it?”

Sorry, I still think I’m missing the main point, which is my fault because I got side tracked.

So in the cases where you do use data classes, where are you storing the data for them? Is it hard coded in the test cases?

In the data class (the clue being in the name).

Lol okay, thanks

Here you go, a trivial example… used where I’m checking rejected data policies…