Wondering if there are any resources to create test execution scripts or framework to do the data validation from SQL Server to PostgreSQL, can be any DB to DB. I’m trying to do a POC.
Just looking for an example or an framework on how to implement the solution in Katalon.
KS provides nothing for SQL Databases. This forum would not be an appropriate place for you to ask this question.
Well … let us split this a bit:
- SQL Server to PostgreSQL - both drivers are provided in katalon studio by default
- can be any DB to DB - not sure what you are trying to say by this. If the driver it is not provided by default in katalon, you can add any other supported java driver and write your custom connector.
You will, however, need, at a certain moment, to write your custom connector (search the forum for examples) since using just data-binding to compare the data from one DB to the other DB won’t help you much.
I did such in the past when I was testing certain ETL’s.
The idea i used was:
- connect to the source db, run a certain query (e.g
SELECT COUNT * FROM whatever-table)
- connect to the destination db and run a similar query
- compare the results
That will give you a quick test to compare that the number of records between the tables in the DB’s subject to test are the same.
For the rest it is only a matter to run various queries against the DB’s and compare the results (export them as list, iterate one vs the other etc)
Use your imagination
Thanks for your input @bionel.
I understand the concept you are trying to convey. I am following the same method. I just wanted to know how can this be done in katalon?
I am able to connect, execute query, and fetch results from SQL and Postgres SQL in Katalon by using data files.
Where and How can I write a custom groovy code that will match the results of query?
Is there any framework for that?
There is no ‘framework’ …
To decouple your test cases from the Data Binding (which won’t help you much), first you have to make yourself familiar with Custom Keywords.
You can read about them in the doc: https://docs.katalon.com/katalon-studio/docs/introduction-to-custom-keywords.html
You can also take a look at some tutorials, e.g:
There is also a plugin which seems to provide some ‘generic’ connectors as Custom Keywords for various DB types, you can give it a try (not sure how good it is but you can also take a look at the code, it is public on Github and reuse / improve it as needed):
For the rest, search the forum about topics related to data validation, DB connections using Custom Keywords etc.