If you are on a project devloping web applications then sooner or later you will be faced with the challenge of testing your REST APIs. Testing REST API's can pose a bit of a challenge because the teams developing the services and the one developing the GUI to access these services complete their components at diffrent points in time. Most often the backend REST API's are ready while the GUI continues to be built. Moreover these REST services are accessible using API endpoints and a developer/tester has no access to the hardware running them, making it difficult to identify if the desired result was achieved.
We face this very often in our projects and have been able to effectively test API endpoints without having to wait for the GUI components to be completed
Our architectural style includes an AngularJS views (and controllers) that access a BPM REST API for business workflows and rules. Very often the API's are ready while the GUI continues ti be built. To test the rest API's we use one of the following tools/methods
- Postman is available as a native app as well as an add-on for the Chrome Browser. The developers recommend that we use the native app instead of the add-on to test API's. Postman is useful to test the API's as they are being built
- Restlet Client is available as an add-on for the Chrome Browser. Restlet is useful to test the API's as they are being built
- Curl is the one we use most. We create a spreadsheet of parameters for testing and then reference it from another sheet that has the CURL command literals. This gives us the individual CURL statements. We then generate a shell scipts of these commands and run them from the command line. This method allows us to generate several requests consurrently.
Using curl we have been able to generate close to Ten Thousand concurrent requests allowing us to simulate an environment that resembles a "production" environment. We are able to plot the behaviour of the service handling and response times by increasing and decreasing the number of requests sent to the REST service