• info@testbytes.net
  • +91 811 386 5000
  • HR: +91 8113 862 000

Explore Data Driven Testing Through This Brief Note

Tuesday February 12, 2019


data driven testing

Data Driven Testing is an Automation framework where we can iteratively run multiple data set from an external source like a table for the same test scriptinstead of hard coding.

Multiple data setsand test environment can be controlled and run without hard coding and results obtained can be compared.

If data is hard coded it is highly tedious, monotonous and inefficient to run the same test script for different data set.

This becomes easier when data from different sources can be fed as input, this input gets verified and result outputs obtained can be compared.

Why should we go for Data Driven Testing?

In real life applications with frequent changes in data set such as addition, modification and deletion of data, hard coding data makes it difficult or almost impossible to run each time.

Data Driven Testing makes it much easier to use and maintain voluminous data individually in tables.

Manually to cover all the scenarios, a tester may have to design multiple test scripts or edit existing test scripts multiple times and run it individually.

Thus, making this difficult or almost impossible task. For a Manual Tester, it is humongous and monotonous.

That’s exactly when Data Driven Testing comes to the rescue. Test Data can be fed from a table or other sources, independently without making changes to the test script.

All these data run for the same test script iteratively and results obtained can be compared.

Procedure simplified

Test data are stored in an easily maintainable manner like tables or rows and columns and then passed as input variables to the AUT.

Test scripts and Data Provider are two separate entities having no direct impact on each other. Verified results from each test execution are then compared from expected results of the Data Provider.

Data Driven Testing
Data Driven Testing

Data Provider

Data can be fed in different forms. Few popular ones are

  • Internal table
  • Spreadsheet
  • CSV file
  • XML file

Data Driven Script

Scripts containing hard-coded data can be tough to maintain and sometimes they can break the execution.

In Data Driven Testing Test scripts and Test Data are separated and made into separate entities.

Hence Data Provider is independent of test script and both can be modified individually without impacting each other.

Real Life Citation

We shall take anexample of online registration form. Data from Registration forms increase frequently sometimes every day. Each User registration add data rows in database.

1.Let’s take a simple form with Name, Email, Password and Confirm Password

2. Test Scenarios are identified and test cases are designed.

3. For now, consider only happy path – validating that data in table and actual result are correct.

Brief about Data Driven Testing
Brief about Data Driven Testing

4. Now let’s feed multiple data from a spreadsheet, csv file or the like as a table as below

5. During Test execution test script is run and data is taken from the table.Each data is executed one after the other in iteration row after row.

6. Once script is executed, actual results and expected results are compared.

7. Notice that data has been modified – added newly at the end of the table, edited existing in the middle row and deleted in-between the table. This can be easily done by modifying the Data table like below without touching the script.

This can be easily done by modifying the Data table like below without touching the script.

Explore Data Driven Testing Through This brief Note
Explore Data Driven Testing Through This brief Note

8. Data has been modified easily without changing the script.

Automation framework for Data Driven Testing

This method can be used integrating with various Test Automation Tools like Selenium, QTP, TestComplete, TestNG etc    

Advantages of Data Driven Testing

  • Test Data can be stored in a single file making it easy to maintain, monitor and track.
  • Test Data and Test scripts are separate entities. Hence changes in one does not impact the other.
  • Large volumes of data can be executed thereby improving Regression testing and better coverage
  • Smoother maintenance of test scripts making addition, editing and deletion of data rows easy and hence less time consuming
  • Manual effort involved is less and hence it is cost effective

Disadvantages of Data Driven Testing

  • Requires great expertise of scripting language
  • Each time a new test case is designed and a new driver script will be required with different data so that the changes made to the test cases should reflect in the driver script or vice versa.

To sum it up,

Data Driven Testing a very good strategy if we have huge volumes of data to be tested for same scripts provided there is a highly skilled testing team. And it does not suit projects that do not have much work with data.


Hire a Tester