Difference between Keyword driven and Data driven framework :
Data Driven Framework :
It is nothing but data driven test, performing the same functionality with multiple input values by using parametarization with the help of data table or data source is called Data Driven Test.
While automating or testing any application, at times it may be required to test the same functionality multiple times with the different set of input data. Thus, in such cases, we can’t let the test data embedded in the test script. Hence it is advised to retain test data into some external data base outside the test scripts.
Data Driven Testing Framework helps the user segregate the test script logic and the test data from each other. It lets the user store the test data into an external database. The external databases can be
property files, xml files, excel files, text files, CSV files, ODBC repositories etc. The data is conventionally stored in “Key-Value” pairs. Thus, the key can be used to access and populate the data within the test scripts.
Ex: Let us consider the “Gmail – Login” Functionality.
First and the foremost step are to create an external file that stores the test data
(Input data and Expected Data). Let us consider an excel sheet for instance.
- The most important feature of this framework is that it considerably
reduces the total number of scripts required to cover all the
possible combinations of test scenarios. Thus lesser amount of code
is required to test a complete set of scenarios.
- Any change in the test data matrix would not hamper the test script code.
- Increases flexibility and maintainability.
- A single test scenario can be executed altering the test data values.
Keyword Driven Testing Framework:
The Keyword driven testing framework is an extension to Data driven Testing Framework in a sense that it not only segregates the test data from the scripts, it also keeps the certain set of code belonging to the test script into an external data file.
These set of code are known as Keywords and hence the framework is so named. Key words are self-guiding as to what actions needs to be performed on the application.
The keywords and the test data are stored in a tabular like structure and thus it is also popularly regarded as Table driven Framework. Take a notice that keywords and test data are entities independent of the automation tool being used.
Ex: For example keywords like
login, clickLink and verifyLink are defined within the code.
- In addition to advantages provided by Data Driven testing, Keyword
driven framework doesn’t require the user to possess scripting
knowledge unlike Data Driven Testing.
- A single keyword can be used across multiple test scripts.