Service Virtualization

  • 1.  Filter all rows from JDBC resultset and store it in a property for validation

    Posted Sep 05, 2017 05:21 AM

    Hello,

     

    My requirement is to filter all rows returned from JDBC resultset and validate all the column values present in each row against the values present in a xml. Also the main condition is that row count is not fixed , so I cannot use "extract value from jdbc resultset" filter , since it accept row count as integer only , I cannot use any property.

     

    Any help would be appreciated.



  • 2.  Re: Filter all rows from JDBC resultset and store it in a property for validation

    Broadcom Employee
    Posted Sep 05, 2017 05:58 PM

    Can you try to write the Step response from the JDBC step to  a  file  and compare that file with the XML ?  



  • 3.  Re: Filter all rows from JDBC resultset and store it in a property for validation
    Best Answer

    Broadcom Employee
    Posted Sep 05, 2017 11:25 PM

    Hi,

        Create a Dataset using "Read rows from JDBC Table" which will create a datasheet based on the query you gave in the dataset and it creates properties for all the columns. Then in next step, read the xml file and apply "XML Xpath filter" and apply xpath query to the xml content and save each attribute to the property.

        Now, you have both the properties. One from database and one from Xml. So, you can compare it using any assertions or you can write "scripted assertion" to compare these properties.

     

    Thanks & Regards

    Srikanth Gajawada