Thursday, 20 February 2025

Differentiate between Data Driven Framework and Keyword Driven Framework

A framework in automated testing is a collection of rules, best practices, and resources used to automate software application testing. Frameworks offer an organised method for effectively creating, managing, and organising automated test scripts. They contribute to increased test coverage, better maintainability, reusability, and reduction of redundancy. 

The purpose of the Data-Driven Framework is to isolate the test data from the test logic. It increases the flexibility and reusability of the tests by enabling the execution of the same set of test scripts using several data sets.

Every action (or keyword) in a test is linked to a particular function in the Keyword-Driven Framework, also called the Table-Driven Framework. The test scripts are constructed in a manner that defines and stores the operations (keywords) in an external file or table.

Data Driven FrameworkKeyword Driven Framework
Requires understanding of scripting and handling data files.Can be used by non-programmers once keywords are defined.
Easier to maintain test data separatelycomplex with a large number of keywords.
One test script is executed with multiple data inputs.One test script is executed based on a sequence of keywords.
Best suited for Tests with varying data, such as login scenarios with different credentials.Best suited for Tests with standard actions (e.g., opening a browser, clicking buttons).
Test data is stored separately (e.g., Excel, CSV).Test steps (keywords) are stored in a data table (e.g., Excel, CSV).
Test scripts are written to handle data inputs.Test scripts are written to handle keywords (actions).
High reusability by reusing the same test script with different data.High reusability by reusing the same keywords across multiple test cases.