0

Is it is good practice while writing automated tests for APIs to compare the complete response of the requests with a benchmark response instead of writing specific tests to verify the required values ? What if there are too many values to verify ? Is there any clean and optimized way to do the same ?

Please share thoughts so that I may know about the best standard followed industry wide.

1
  • 1
    What's the difference between comparing complete response to individual values ? if the benchmark response was built with common sense while being aware of its content then it's simply a more efficient way for comparison.
    – Rsf
    May 9, 2019 at 14:41

1 Answer 1

1

It depends on the service. If I'm testing something that doesn't change, or doesn't change often, I would assert the response against a benchmark response.

For those services where the data may change, I would look to write some sort of validation script to compare the response results with the db.

1
  • Thanks for the insights Chris
    – mu1988
    May 15, 2019 at 4:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.