Forum Discussion
Thank you for posting to our Community Forum.
Since you need to create a dynamic assertion, I would explore the "Script" assertion. I am sure you can meet your requirements through that.
Here is our documentation on it: https://support.smartbear.com/readyapi/docs/testing/assertions/reference/script.html
Let me know if you have any questions/concerns.
- sprice0901617 years agoContributor
Thank you for your response.
Yes I'm aware of the script assertion, and I recognize that I this will be a script assertion. What I'm looking for is a typical strategy used in writing such a script.
For example:
I want to assume that I don't know how many offers would be in the response. The first part of the assertion (Or some prior test step) might be to perform a DB query to discover the number of offers available, as my Expect Data. Then capture the number of offer nodes in the output , Actual Data, and compare Expected and Actual values.
I want to capture and store the output data as well.
I'm not sure how to work with the JSON response and order the data into something I can compare against.
Since writing this I have added a Datasource of type JDBC, which has queried the database and returned each offer and their related properties in the same order as the offers appear in the output. Now I need a way to iterate through each offer and perform assertions on each property Expect vs. Actual Values.
Related Content
Recent Discussions
- 24 hours agoKay