Forum Discussion

rajs2020's avatar
rajs2020
Frequent Contributor
4 years ago
Solved

ReadyAPI - How to validate the results of a datasource?

When we use a data source (DB, API, file etc.) in a test, then it is best to check if we got the right data before running the test. In case of DB, the right data can be the right number of rows and/...
  • ChrisAdams's avatar
    4 years ago

    Hi,

     

    Assertions tend to be used to ensure the response from some service is valid.  I'm not sure why you'd doubt the data source, and assertions in the data-source step are something I've never felt required.

     

    If you do doubt your source, or want to check the rows prior to running a test, then the only thing I'd suggest is adding a JDBC Test Step before the datasource step and apply the assertions there.  If the assertion fails, then don't run the test.