SDET Unicorns

Data Driven Testing using Newman CLI

Table of Content

API testing is a crucial aspect of modern software development, and data-driven testing is an effective technique to test APIs with varying input data. Newman CLI is a powerful tool that can be used to automate API testing and perform data-driven testing. Let’s see how we can do that –

What is Newman CLI?

Newman CLI is a command-line tool developed by Postman that allows you to run Postman collections from the command line. It provides a way to execute Postman collections in an automated and continuous manner, making it a popular tool for API testing and integration testing.

Prerequisites

  1. Create a Postman collection with the requests to be tested.
  2. Optionally, write tests for each request to validate the expected results.
  3. Export the collection so that it can be accessed by Newman CLI.
  4. Prepare a data file in CSV or JSON format to provide different input data for each test run.

Check out this post to see how to do this step-by-step.

How to do Data Driven Testing using Newman CLI?

To conduct data-driven testing with Newman CLI, you must execute the collection with the newman run command and then use the -d flag to provide the data file. Here’s an example:

newman run sample.postman_collection.json -d data.json

The above command will run all the iterations and return similar results –

newman cli data driven test run
Newman CLI Data Driven Test Run

To learn more, check out the video below –


Conclusion

Data-driven testing is a powerful technique to test APIs with varying input data. Newman CLI is a powerful tool that can be used to automate API testing and perform data-driven testing. With Newman CLI, you can easily perform data-driven testing and catch bugs and issues early in the development cycle.


??‍? Unleash Your Full Potential and Take Your Career to the Next Level with SDET-U Academy ??
Join Academy

? Subscribe to my mailing list to get access to more content like this as well as be part of amazing free giveaways.

? You can follow my content here as well –

Thanks for reading!

My Resources

Thrive Suite: The all-in-one WordPress theme I used to create my blog.
Jasper AI: My favorite AI writing tool.
Surfer SEO:  A tool to help you rank your content on the first page of Google.

Write Content Faster

5/5

Write blog posts that rank for affiliate terms!

Join our mailing list

Unlock the Secrets to Becoming a SDET Pro in the Industry!

Stay ahead of the curve! Join our mailing list for exclusive insights, tips, and the latest industry updates delivered straight to your inbox

Table of Content

Related Post

equivalence and boundary value

Understanding Equivalence Partitioning and Boundary Value Analysis in Software Testing

Software testing techniques help ensure software quality and reliability, by helping us select test cases intelligently from the collection of test cases, such that all test scenarios are covered.

Boundary Value Analysis and Equivalence Partitioning are two testing techniques that help testers select a subset of test cases that covers all important test scenarios, even under time and budget constraints. By testing all the equivalence classes and boundary values, testers can reduce the risk of releasing software with defects.

Read More »