Thursday, March 10, 2011

What is Keyword Driven Testing?

Following are the basic components of a Keyword Driven framework:

1. The Control File
2. Test Cases File
3. Startup Script
4. Driver Script
5. Utility Scripts

The Control File:

The control file the main component of the Key word driven testing and it consists of all the Test scenarios to be automated/run. For the current run, the user will be able to select a specific scenario to be executed or not. For achieving this we will have a flagging column on the control file and based on turning it on or off the script execution will be determined.

The control File is in the form of an excel worksheet and contains columns for Scenario ID, Short description, Execute (Y/N),Object Repository Path, Test Case File Path etc.

Following is a sample control file:

Test Cases File:

The test cases file contains the detailed steps to be carried out for the execution of a test case. Also, this file is in the form of an excel sheet and contains columns for Keyword, Object Name, Parameter etc.

Sample Test Cases file:

Startup Script:

The Startup script is the first executable script and it initializes and reads the contents of the control file. Then it starts executing all the scenarios marked "Yes" for execution in the control file.

Driver Script:

The driver script reads the Test Case files and Checks for the keywords. This script is responsible for calling the appropriate utility script functions based on specific set of keywords. We need to take care of the error handling aspects in the driver script.

Utility Scripts:

Perform generic tasks (Example : Browsehome, Login, Logout, CloseBrowser etc.) that can be used across applications.

Architecture of Keyword Driven framework:

(Click on the image to enlarge)

Advantages of Key word driven framework:

The main advantage of this framework is the low cost for maintenace.
The framework can be application independent
If there is any change to the test case only then the Test Case File needs updation (But still we can use the same Driver Script and Startup script)
No need to update the scripts in case of changes to the application.


Please leave your comment here...