Data Driven Framework:: Property Files, XML Files, Excel Files, Text Files, CSV Files, ODBC Repositories
Data Driven Framework:: Property Files, XML Files, Excel Files, Text Files, CSV Files, ODBC Repositories
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.
Pros:
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.
Pros:
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.
Data- Driven testing is a framework where test input and output values are read from
data files (datapools, ODBC sources, csv files, Excel files, DAO objects, ADO objects,
and such) and are loaded into variables in captured or manually coded scripts. In this
framework, variables are used for both input values and output verification values.
Navigation through the program, reading of the data files, and logging of test status and
information are all coded in the test script.
Fortunately, this heavy, initial investment is mostly a one-shot deal. Once in place,
keyword driven automation is arguably the easiest of the data driven frameworks to
maintain and perpetuate providing the greatest potential for long-term success.
Here for keywords, we will use Excel files to maintain test cases, and for test
data, we can use data, provider of Testng framework.