Data Driven Framework

Please explain data driven framework as it can be explained to an interviewer.

taqueem Default Asked on November 27, 2014 in Selenium WebDriver.
Add Comment
1 Answer(s)

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.

Note: The test data stored in an external file can belong to the matrix of expected value as well as matrix of input values.

Example:

Let us understand the above mechanism with the help of an example.

Let us consider the “Gmail – Login” Functionality.

Step 1: 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.
Step 2: The next step is to populate the test data into Automation test Script. For this purpose several API’s can be used to read the test data.

Pros:

  1. 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.
  2. Any change in the test data matrix would not hamper the test script code.
  3. Increases flexibility and maintainability
  4. A single test scenario can be executed altering the test data values.

Cons:

  1. The process is complex and requires an extra effort to come up with the test data sources and reading mechanisms.
  2. Requires proficiency in a programming language that is being used to develop test scripts.
swathirajan Train Answered on November 28, 2014.

Thanks for your quick response. But I expected the explanation in a graphical way and the different parts of the framework to be described clearly. I was going through the questions of selenium interview on toolsqa.com and it was advised that You should be able to describe for at least twenty minutes on it. So I will be very much thankful if you  reply on this.

Please see this link as it explains keyword driven approach
http://www.toolsqa.com/selenium-webdriver/keyword-driven-framework/introduction/

on November 28, 2014.

Hi Taqueem,

The explanation given above by Swathirajan is superb and sufficient for explaining Data Driven Framework. I am not sure where I have mentioned that it should take 20 mins, maybe I was referring to complete framework. Take my words for Data Driven above is the best. For Framework or for Hybrid framework, see our tutorial on Hybrid Driven Framework and you might need to explain every chapter of it for at least 1 min each to explain the complete structure of the framework and that will take 10 mins to complete.

PS Swathirajan : Thanks for your help buddy.

Regards,
Lakshay Sharma

on November 28, 2014.

Thanks a ton Lakshay!!!

@Taqueem: Welcome :)

on December 1, 2014.

@ Taqueem: Please close this question.

on December 2, 2014.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.