Compare datasource(expected data) with actual data in the database

HiChampionHiChampion Posts: 1

Hi Parasofters,

I have a problem. I am putting data in a database(SQL developer) via a process which loads some XMLs in the database. I have the expected data in a datasource in parasoft soatest.
I want to compare the actual data in de database with the expected data in the datasource within parasoft soatest. How can I do that? What ways are there?

I know that you can use assertions. But the problem there is. For example. In 1 situation I have 2 records, in the database 2 records and in the datasource 2 records. But the assertions just compares both databaserecords with the first row of the datasource. Not the 1 record of the database with the first records of the database and the second record of the databse with the second record of the datasource. How can I solve this?
I would want to know this and also if there are another ways to compare database records with some expected data.

Thank you in advance!

Comments

  • benken_parasoftbenken_parasoft Posts: 1,009 ✭✭✭

    There are different approaches but I will describe one type of approach: If you get the expected data and the actual data base records into a common document format then you can simply compare the two documents for equality using the Diff tool.

    SOAtest's DB Tool produces a SQL result set as an XML document. If you can represent the expected data as a similar XML document then you can just diff the two XML documents. You would chain the Diff tool directly to the DB Tool in this case.

    You can also use some other document format like CSV, in case your expected data is already in CSV format. You can use XSLT or a script to convert the result set XML from the DB Tool to CSV. You would chain the Diff tool to whatever is returning the result set as CSV (XSLT tool or Extension tool, for example).

Sign In or Register to comment.