Table of Contents
Enroll in Selenium Training

What is Keyword Driven Framework?

Keyword Driven Framework is a type of Functional Automation Testing Framework which is also known as Table-Driven testing or Action Word based testing. The basic working of the Keyword Driven Framework is to divide the Test Case into four different parts. First is called as Test Step, second is Object of Test Step, third is Action on Test Object and fourth is Data for Test Object.

The above categorization can be done and maintained with the help of Excel spread sheet:

Test Step: It is a very small description of the Test Step or the description of the Action going to perform on Test Object.

Test Object: It is the name of the Web Page object/element, like Username & Password.

Action: It is the name of the action, which is going to perform on any Object such as click, open browser, input etc.

Test Data: Data can be any value which is needed by the Object to perform any action, like Username value for Username field.

The idea behind the Keyword Driven approach in automation is to separate the coding from the test case & test step. This helps a non technical person to understand the automation very well. With this a manual tester can write Automation scripts. This does not mean that an automation tester is not needed but in any Keyword Driven project, a hard core technical coder is must needed for setting up the framework and to work on regular changes and updates of background automation code. But for an example an automation team can have two manual tester and a automation coder.

Let just understand this concept with the help of an example of our Demo Online Store Application. Consider that you have to automate a flow where you would need to do the following things:

  1. Open a Browser
  2. Navigate to URL
  3. Click on My Account button
  4. Enter Username
  5. Enter Password
  6. Click on LogIn button
  7. Click on LogOut button
  8. Close the Browser

Below is the list of common components that you would required to achieve the task:

  1. Excel Sheet: This is the sheet which keeps most of the data for Keyword Driven which is needed for the test like Test Case, Test Steps, Test Objects and Actions.
  2. Object Repository: Property file to store the html elements properties of the web application, this property file will be linked with the Objects in the test
  3. Keyword Function Library: In keyword Driven Framework function file plays an important role, as it stores the working of the actions, so that each action can be callable from this file
  4. Data Sheet: Excel file to store the Data value needed by the object to perform some action on it
  5. Execution Engine: Test is the only test script we have in Keyword Framework and it contains all the code to drive the test from Excel sheet, Function Lib and Properties file.

The below image shows the generic work-flow of Keyword Driven Framework:

The below image shows the generic work-flow of Keyword Driven Framework

From the above figure, you can see that the generic flow of a Keyword Driven Framework is something like this -

  • Execution Engine starts the test and connect with the bundle of test cases and start executing one by one
  • Once Test Case is picked, linked test steps are followed sequentially
  • Test Steps are further connected with Page Objects, Actions & Test Data
  • Once Execution Engine gets all the required info to perform a test step, it connects with application and do the step.

Advantages:

  1. Less Technical Expertise: Once Framework is set up, manual testers or non technical testers can easily write test scripts for automation.
  2. Easy To Understand: As it is maintained in Excel sheet and no coding is exposed, the test scripts are easy to read and understand. Keywords & actions resemble so closely manual test cases, which become easier to write and maintain.
  3. Early Start: You can start building Keyword Driven test cases before the application is delivered, as Object Repository can be easily set up at the later stage. Using information gathered from Requirements or other documentation, keyword data tables can be created that mirror corresponding manual test procedures.
  4. Re-usability of component: With implementing modularization in Keyword Driven, Re-usability can be further increased.
  5. Re-usability of code: As there is just one Execution Engine in Keyword Driven Framework, it encourage extreme code re-usability.

Enough talk about it lets get started.

Selenium Automation Hybrid Framework (Data Driven & Modular Driven)
Selenium Automation Hybrid Framework (Data Driven & Modular Driven)
Previous Article
Steps to Set up Keyword Driven Framework
Steps to Set up Keyword Driven Framework
Next Article
Lakshay Sharma
I’M LAKSHAY SHARMA AND I’M A FULL-STACK TEST AUTOMATION ENGINEER. Have passed 16 years playing with automation in mammoth projects like O2 (UK), Sprint (US), TD Bank (CA), Canadian Tire (CA), NHS (UK) & ASOS(UK). Currently, I am working with RABO Bank as a Chapter Lead QA. I am passionate about designing Automation Frameworks that follow OOPS concepts and Design patterns.
Reviewers
Virender Singh's Photo
Virender Singh

Similar Articles

Feedback