Using SoapUI to compare data between two Database

To compare the data between two Database, we could use SoapUI with groovy script. The below solution could be easily replicated to work on any Data Table.

Create a SoapUI project with TestCase as shown in the screenshot.

(1) Create a SoapUI project with below properties.

(2) The Custom properties on TestCase level is the primary key column for the data table we are comparing.

(2) DB Connection Setup is a script to read DB connection string from a text file.

(3) Source DB Fetch and Target DB Fetch are JDBC request to fetch the data from corresponding database using giving query.

(4) Verify DB Results is groovy script to compare the data and output the discrepancies to a file

Source Code: https://github.com/pamelaguo888/autotesting/blob/main/compare_data.groovy