Postman Beginner Tutorial 13 | Data Driven Testing | How to get data from CSV and JSON files

Automation Step by Step
7 Jul 202221:13

Summary

TLDRThis tutorial by Raghav introduces data-driven testing with Postman, guiding viewers step-by-step to create API requests, parameterize them with data from CSV and JSON files, and execute data-driven API tests. It also covers referencing data in test scripts, validating JSON data, and running tests with Postman's collection runner, ensuring a comprehensive understanding of the process.

Takeaways

  • 😀 The tutorial is about learning data-driven testing with Postman from scratch.
  • 🔍 Raghav, the instructor, guides through the process of setting up data-driven API requests using Postman.
  • 📝 The script covers how to get data from both CSV and JSON files for testing purposes.
  • 💻 Postman can be accessed either through a browser or a desktop application.
  • 📥 The process includes creating an API request, modifying it, and saving it in a collection for organization.
  • 🔑 Variables are parameterized within the request to refer to data from external files.
  • 📈 Raghav demonstrates how to create and use a CSV file with sample data for the API request.
  • 📊 The tutorial also shows how to create and validate a JSON file for similar purposes.
  • 🔄 Postman's Collection Runner is used to execute API requests with data from the files.
  • 📋 The script explains how to refer to data from the files within test scripts using specific syntax.
  • 🛠 The importance of validating JSON data for correctness is highlighted to avoid errors in testing.

Q & A

  • What is the main topic of the video?

    -The main topic of the video is how to perform data-driven testing with Postman, starting from scratch.

  • What are the data sources mentioned for data-driven testing in Postman?

    -The data sources mentioned for data-driven testing in Postman are CSV and JSON files.

  • How does one create an API request in Postman as shown in the video?

    -In the video, an API request is created by clicking the plus button in Postman, selecting an API from the 'req res dot in' website, copying the endpoint, and pasting the request body as JSON.

  • What is the purpose of saving the API request in a collection?

    -Saving the API request in a collection helps organize and manage the requests, making it easier to run multiple related requests together and maintain a clean structure.

  • How can you parameterize parts of the API request in Postman?

    -Parts of the API request can be parameterized by using double curly brackets and the variable name, such as '{{endpoint}}', '{{email}}', and '{{password}}'.

  • What tool can be used to create a CSV file on a Mac system?

    -On a Mac system, the Numbers application can be used to create a CSV file, which is similar to Excel.

  • How does the video demonstrate the use of a CSV file for data-driven testing?

    -The video demonstrates the use of a CSV file by showing how to create it in Numbers, fill it with data corresponding to the API request parameters, and then use it in the Postman collection runner.

  • What is the significance of the '201 Created' status code mentioned in the script?

    -The '201 Created' status code signifies that a new resource has been successfully created in response to the POST request in the API.

  • How can you verify the validity of JSON data before using it in Postman?

    -You can verify the validity of JSON data by using online JSON formatters or validators, which check the syntax and structure of the JSON file.

  • What is the difference between using data variables in Postman directly and using them in data files?

    -In Postman, using data variables directly involves referencing them with double curly brackets. However, when using data files, you must reference the data with 'data' followed by the variable name or header name in square brackets, such as 'data[email]'.

  • How can you run tests within the API request in Postman?

    -Tests can be run within the API request in Postman by writing test scripts in the 'Tests' tab of the request. These scripts can validate the response, such as checking if the status code is '201'.

  • What is the importance of clearing the console before running a new collection in Postman?

    -Clearing the console before running a new collection in Postman ensures that the output is clean and only displays the results of the latest run, making it easier to analyze and understand the results.

Outlines

plate

Этот раздел доступен только подписчикам платных тарифов. Пожалуйста, перейдите на платный тариф для доступа.

Перейти на платный тариф

Mindmap

plate

Этот раздел доступен только подписчикам платных тарифов. Пожалуйста, перейдите на платный тариф для доступа.

Перейти на платный тариф

Keywords

plate

Этот раздел доступен только подписчикам платных тарифов. Пожалуйста, перейдите на платный тариф для доступа.

Перейти на платный тариф

Highlights

plate

Этот раздел доступен только подписчикам платных тарифов. Пожалуйста, перейдите на платный тариф для доступа.

Перейти на платный тариф

Transcripts

plate

Этот раздел доступен только подписчикам платных тарифов. Пожалуйста, перейдите на платный тариф для доступа.

Перейти на платный тариф
Rate This

5.0 / 5 (0 votes)

Связанные теги
API TestingPostmanData DrivenCSV FilesJSON FilesWeb DevelopmentSoftware TestingRequest HandlingParameterizationTest Automation
Вам нужно краткое изложение на английском?