Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
API Testing and Development with Postman

You're reading from   API Testing and Development with Postman API creation, testing, debugging, and management made easy

Arrow left icon
Product type Paperback
Published in Jun 2024
Publisher Packt
ISBN-13 9781804617908
Length 358 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Dave Westerveld Dave Westerveld
Author Profile Icon Dave Westerveld
Dave Westerveld
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

Preface 1. API Terminology and Types 2. API Documentation and Design FREE CHAPTER 3. OpenAPI and API Specifications 4. Considerations for Good API Test Automation 5. Understanding Authorization Options 6. Creating Test Validation Scripts 7. Data-Driven Testing 8. Workflow Testing 9. Running API Tests in CI with Newman 10. Monitoring APIs with Postman 11. Testing an Existing API 12. Creating and Using Mock Servers in Postman 13. Using Contract Testing to Verify an API 14. API Security Testing 15. Performance Testing an API 16. Other Books You May Enjoy
17. Index

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:

  1. Add a collection called JSON API.
  2. Add a request to the collection called Users.
  3. 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's look at how to set up a data...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime