Creating a data-driven test in Postman
Postman provides tools for running data-driven tests, but in order to use them, you will need a test. This section will show you how to create an actual input file that you can use, and it will then teach you how to create the kind of test that you need for this in Postman. It will also show you how to get data from a file and use that data to compare it to the results of your request.
I will show this all to you with a practical example. The example will use the API provided by JSON Placeholder (http://jsonplaceholder.typicode.com). This is a sample API that you can use to get fake data. Before creating a data-driven test, follow these steps:
- Add a collection called
JSON API
. - Add a request to the collection called Users.
- Set the request URL to http://jsonplaceholder.typicode.com/users/1 and send the request. You should get back a response with a bunch of data for a user.
Now that you have a working request, let&apos...