The Goals of API Testing
Learn to test API endpoints to ensure they accept valid inputs and return expected responses. Understand behavior-driven development principles to test both happy-path and sad-path scenarios for robust API validation.
We'll cover the following...
Overview
First and foremost, the goal of API testing is to do just that—test the interface. That means we need to test each URL or endpoint in the API, including any possible input parameters. We also need to confirm the responses to those endpoint requests. For example, we need to make sure each promised endpoint exists as well as accepts the inputs and produces the expected outputs. But that’s just a start.
Testing the API’s behavior
In addition to testing the interface, we also need to make sure the API behaves the way we’d expect—from reading the ALPS description and the OAS documents. For example, an API might have a rule that each request for a credit rating should return a value between 1 and 10. If the API returns a value of 0 or 13, that’s unexpected behavior.
Another API might have a rule that we can’t create two records with the same companyName value. That means any attempt to break that ...