What is Data-Driven Testing?
Data-driven testing is the creation of test scripts where Test Data and/or Output Values are read from data files instead of using the same hard-coded values each time the test runs. It allows us to import or read the Test Data and/or expected Output Data from external files or data sources and feed the data into our Automated Test Cases so that we don't need to hard-code the test data into the Test Steps definition. The Test Steps iterates itself and consequent rows of data are fed to the Test Steps as input.
Data Driven Testing - Flowchart
For Example, A login form can be tested for multiple data inputs by feeding in different login data.
Creating a Data-driven Test Case in Testsigma
Testsigma makes the task of creating Data-driven Test Cases an easy one. There are only two steps to create a Data-driven Test Case in Testsigma and they are:
Creation of a Test Data Profile for the Data-driven Testing
Setting the Test Data profile for your Data-driven Test Case
1. Creation of a Test Data Profile for the Data-driven Testing
A Test Data Profile can be created using two methods:
- Create Test Data Profile using JSON Object format
Please refer this article for a detailed guide on creating Test Data Profile using JSON Object format - How to create Test Data Profile?
- Create Test Data Profile by importing data from a Microsoft Excel file
Please refer this article for a detailed guide on creating Test Data Profile by importing data from a Microsoft Excel file - How To import Test Data Profile?
2. Setting the Test Data profile for your Data-driven Test Case
Creation of a Data-driven Test Case is no different from creating a normal Test Case. There are just two things you need to perform to convert a normal Test Case to a Data-driven Test Case.
- Select the Data-driven toggle button while creating the Test Case.
- Provided the Test Data Profile is already created as given in step 1, select the Test Data Profile in Test Data Profile field while creating the Test Case.
We have successfully created a Data-driven Test Case with the Test Data profile Login data. Now we can add some Test Steps to the Test Case.
Please refer this article for more details on creating data-driven Test Steps - How to use Test Data Profile in Test Steps?