Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

DB Validation at Row Level

bharatbarz
bharatbarz Posts: 44
edited October 2022 in SOAtest

Hi Team,

I am reading DB with a query and the results I am storing in an XML data bank. Each Row will have 6 columns and one of which is a status column. I need to check for all rows if status column is a fixed value( say., 'S'). I created tests as enclosed. When i am trying to assert, the assertion doesn't shows the failure results at row level and it shows only at distinct Status fields. Please let me know how to get the assertion results at row level.

Answers

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭
    edited October 2022

    the assertion doesn't shows the failure results at row level

    If the configured XPath matches all "CASHR_RQST_STAT_CD" elements then you should see a violation for each element that didn't match the expected value.

    it shows only at distinct Status fields

    By default, only distinct violations are reported. You can change this from Parasoft > Preferences > Misc > Duplicate Errors > Report each duplicate error.

  • bharatbarz
    bharatbarz Posts: 44

    Hi Benken, I didn't understand the XPath response you have given. Since the DB Query may result in a result set which will not be having same number of rows, I extracted the ROWS element and kept "All Child Nodes" Extract Content Only option. Could you help to explain bit more elaborately?

  • bharatbarz
    bharatbarz Posts: 44

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭

    You were asking about the violations reported by your XML Assertor, correct? The "Selected Element" configuration in your XML Assertor contains an XPath that is used to match the nodes from your XML document. Since you are getting multiple violations then your XPath must have selected all "CASHR_RQST_STAT_CD" elements which is probably what you want if you are trying to validate that they all equal "APPR".

    Concerning your XML Data Bank, what are you using that for? Do you have a specific question about it? It serves a different purpose than the XML Assertor. Both tools operate independent of one another.