Chapter 7. Data-Driven Testing

In this chapter, we will cover:

  • Creating a data-driven test using JUnit
  • Creating a data-driven test using TestNG
  • Reading test data from a CSV file using JUnit
  • Reading test data from an Excel file using JUnit and Apache POI
  • Creating a data-driven test in NUnit
  • Creating a data-driven test in MSTEST
  • Creating a data-driven test in Ruby using Roo
  • Creating a data-driven test in Python using DDT

Introduction

The data-driven testing approach is a widely used methodology in software test automation. We can use the same test script to check different test conditions by passing set of data to the test script.

We will use the BMI calculator application as an example to understand the data-driven testing approach.

When testing whether the ...

Get Selenium Testing Tools Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.