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?
@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 âŚ
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 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?â