---
description: KEYWORD-DRIVEN TESTING is a scripting technique that uses data files to contain the keywords related to the application being tested. These keywords describe the set of actions that is required to perform a specific step.
title: Keyword Driven Testing Framework with Example
image: https://www.guru99.com/images/keyword-driven-testing-framework.png
---

 

[Skip to content](#main) 

**⚡ Smart Summary**

Keyword Driven Testing separates test logic from automation code by mapping plain-language keywords to reusable functions, so testers design, maintain, and scale automated suites through spreadsheets instead of writing scripts for every individual test case.

* 🔑 **Keyword Basics:** Every action such as openbrowser, click, or Typtext becomes a self-describing keyword backed by exactly one function.
* 🧩 **Four Building Blocks:** Excel sheets, a function library, data sheets, and an object repository keep steps, objects, actions, and data separate.
* 📊 **Table-Driven Design:** Testers write cases as keyword rows with parameters, so no scripting language knowledge is required to author a test.
* ⚙️ **Driver Script Execution:** A driver script reads each keyword, calls the mapped function, and writes the result back to the sheet.
* 🧪 **Tooling Choice:** HP QTP, Selenium, and Robot Framework all interpret keyword tables without custom parsing.
* ⚖️ **Framework Fit:** Hybrid setups pair keywords with data-driven inputs to widen coverage without duplicating a single test step.
* 🚧 **Plan For Overhead:** Upfront keyword design and library upkeep cost real time, so keep the vocabulary small and review it every release.

[ Read More ](javascript:void%280%29;) 

![](https://www.guru99.com/images/keyword-driven-testing-framework.png)

## What is Keyword Driven Testing?

**Keyword Driven Testing** is a scripting technique that uses data files to contain the keywords related to the application being tested. These keywords describe the set of actions that is required to perform a specific step.

A keyword-driven test consists of high and low-level keywords, including the keyword arguments, which is composed to describe the action of a test case. It is also called table-driven testing or action word based testing.

The **Keyword Driven Framework** is the functional automation testing framework built around that technique. It divides test cases into four different parts in order to separate coding from test cases and test steps for better automation: the test steps themselves, the objects those steps act on, the actions performed on those objects, and the data supplied to them.

In Keyword Driven Testing, you first identify a set of keywords and then associate an action (or function) related to these keywords. Here, every testing action like opening or closing of browser, mouse click, keystrokes, etc. is described by a keyword such as **openbrowser, click, Typtext** and so on.

The diagram below shows two ordinary business actions turning into reusable keywords. **For Example**:

[![](https://www.guru99.com/images/1/042616_0457_WhatisKeywo1.png)](https://www.guru99.com/images/1/042616%5F0457%5FWhatisKeywo1.png)

1. **login** to “guru99” website – Keyword “login” will be used in our automation framework, to the test the login function or action associated with it.
2. **logout** to “guru99” website— Keyword “logout” will be used in our automation framework, to test the logout function or action associated with it.

You will see more examples further in the article. The pattern never changes: one business action, one keyword, one function.

### Example of Keywords

The glossary below lists typical keywords for a banking application and the business action each one triggers.

| Keywords      | Description                        |
| ------------- | ---------------------------------- |
| Login         | Login to guru99 bank demo site     |
| Emails        | Send Email                         |
| logouts       | Log out from guru99 bank demo site |
| Notifications | Find unread notifications          |

**💡 Tip:** Name keywords after the business action, not the technical step. “Login” survives a page redesign; “ClickBlueButton” does not.

## Components of a Keyword Driven Framework

Knowing what a keyword is only takes you halfway. To create a Keyword driven framework you assemble a small set of files, each owning one concern.

1. **Excel Sheet** – Identify the keywords and store them in an Excel sheet, one row per test step.
2. **Function Library** – Consists of the functions for the business flows (the login button for any website). When a test is executed, it reads the keyword from the Excel sheet and calls the functions accordingly.
3. **Data Sheets** – Store the test data used in the application, so one keyword runs against many inputs.
4. **Object Repository** – Holds the locators for every element the keywords touch, so a changed locator is edited in one place.
5. **Test Scripts** – You can have [test scripts](https://www.guru99.com/test-script.html) for each manual [Test Case](https://www.guru99.com/test-case.html) or a single driver script.
6. **Driver Script** – Walks the Excel sheet row by row, resolves each keyword against the function library, and records the outcome.
7. **Automation Tool** – Executes the resolved commands against the application and supplies the reporting layer.

Together these seven pieces form a complete [test automation framework](https://www.guru99.com/test-automation-framework.html). Why choose this design?

## Why do Keyword Driven Testing

In Software Engineering, Keyword Driven Testing is done due to following reason

* Common components handled by standard library
* Using this approach tests can be written in a more abstract manner
* High degree of reusability
* The detail of the script is hidden from the users
* Users don’t have to use the scripting languages
* The test is concise, maintainable and flexible

Because the keyword layer absorbs application changes, a large [regression testing](https://www.guru99.com/regression-testing.html) suite stays green by editing a handful of functions instead of hundreds of scripts. That reasoning shapes how the approach is applied.

### RELATED ARTICLES

* [What is Interface Testing? Types & Example ](https://www.guru99.com/interface-testing.html "What is Interface Testing? Types & Example")
* [REST API Testing Tutorial: Sample Manual Test Cases ](https://www.guru99.com/testing-rest-api-manually.html "REST API Testing Tutorial: Sample Manual Test Cases")
* [Mainframe Testing – Complete Tutorial ](https://www.guru99.com/mainframe-testing.html "Mainframe Testing – Complete Tutorial")
* [6 BEST Software Testing Companies (2026) ](https://www.guru99.com/software-testing-company.html "6 BEST Software Testing Companies (2026)")

## How to perform Keyword Driven Testing

Keyword Driven Testing can be done in both ways, manually as well as automated. But usually, it is used with automated testing.

The objective behind automating Keyword Driven Testing is

* It helps to reduce maintenance cost
* Avoids duplicated specifications
* Greater reuse of function scripting
* Better testing support and portability
* Achieve more testing with less or same effort

With Keyword Driven Testing, you can create simple [functional tests](https://www.guru99.com/functional-testing.html) in the earlier stages of development, testing the application piece-by-piece. The simplest way to compose a keyword driven test is to record it. After recording, the test can be modified and customized as per the requirement.

Each keyword needs to be linked with at least one command, test script or function, which implements the actions related to that keyword.

When test cases are executed, keywords are interpreted by a test library, which is called by a test automation framework.

The major activities involved in Keyword Driven Testing are

* **Step 1)** Identifying low level as well as high-level keywords
* **Step 2)** Implementing the keywords as executable
* **Step 3)** Creating test cases
* **Step 4)** Creating the driver scripts
* **Step 5)** Executing the automation test scripts

Steps 1 and 2 are one-time design work; steps 3 to 5 repeat every sprint, as the samples below show.

## Sample test cases

These three scenarios reuse the same keywords defined earlier.

1. TC\_01: Login to guru99 demo site, find out how many transactions is carried out today
2. TC\_02: Login to guru99 demo site, send an email to one of your customer and then logout
3. TC\_03: Login to guru99 demo site and check for any notification received

Written as a keyword table, TC\_02 becomes six rows any tester can read or reorder without opening the code:

| Step | Keyword      | Argument             | Expected result         |
| ---- | ------------ | -------------------- | ----------------------- |
| 1    | openbrowser  | Chrome               | Browser session starts  |
| 2    | Login        | mngr123 / demopass   | Manager home page shown |
| 3    | Emails       | customer@example.com | Compose window opens    |
| 4    | click        | Send                 | “Mail sent” appears     |
| 5    | logouts      | –                    | Session closed          |
| 6    | closebrowser | –                    | Browser released        |

Swapping the argument in step 3 turns the same six rows into a different test, which is where [test data](https://www.guru99.com/test-data-generation.html) management pays off.

## Advantages of Keyword Driven Testing

* It allows functional testers to plan test automation before the application is ready
* Tests can be developed without programming knowledge
* It is not dependent on a specific programming language or tool
* Compatible with any automation tools available in the market

These benefits explain why Keyword Driven Testing suits long-lived [automated testing](https://www.guru99.com/automation-testing.html) suites. The costs matter too.

## Limitations of Keyword Driven Testing

The abstraction that makes keyword driven tests readable also makes them expensive to build. Before the first test runs, somebody must identify the keywords, implement each as a function, wire up the object repository, and write the driver script. On a small project that setup costs more than scripting the tests directly.

Maintenance is the second cost. The library is shared by every test, so one careless edit breaks the whole suite. Libraries also sprawl: teams add near-duplicates such as “Login”, “SignIn” and “DoLogin”.

* **High initial investment** – framework design and keyword implementation precede any test run.
* **Reduced flexibility** – testers express only what existing keywords allow, so unusual scenarios need development.
* **Awkward for complex logic** – branching and loops resist flat table rows.
* **Skills are still required** – the keyword layer is code-free, the function library is not.

**⚠️ Warning:** Review the keyword library every release and delete unused entries. An uncontrolled vocabulary is the single most common reason keyword driven frameworks are abandoned.

These trade-offs shape the comparison below.

## Keyword Driven vs Data Driven vs Hybrid Framework

Keyword driven and [data driven testing](https://www.guru99.com/data-driven-testing.html) solve different problems. A data driven framework varies the inputs of a fixed script; a keyword driven framework varies the steps. The table adds the hybrid model most enterprise teams adopt.

| Aspect                     | Keyword Driven Framework        | Data Driven Framework          | Hybrid Framework            |
| -------------------------- | ------------------------------- | ------------------------------ | --------------------------- |
| What is externalised       | Test steps and actions          | Test data only                 | Both steps and data         |
| Planning effort            | Extensive and precise           | Limited to data and scripts    | Highest                     |
| Maintenance                | Easier, more abstraction layers | Harder, abstraction is thinner | Easiest at scale            |
| Coding skill needed        | Only for the function library   | Required for every script      | Required for the core layer |
| Can start before the build | Yes                             | No                             | Yes                         |

In practice the styles combine. A hybrid framework stores steps as keywords and inputs in data sheets, often over a [Page Object Model](https://www.guru99.com/page-object-model-pom-page-factory-in-selenium-ultimate-guide.html). Choose keyword driven when many testers write tests, data driven when one flow needs many inputs, and hybrid when both apply.

## Tools used for Keyword Driven Testing

Several tools are extensively used for Keyword Driven Testing, each interpreting the keyword table differently.

* [HP QTP](https://www.guru99.com/quick-test-professional-qtp-tutorial.html) – ships with a built-in keyword view, so the sheet and the executable test are one artefact.
* [Selenium](https://www.guru99.com/selenium-tutorial.html) – has no native keyword layer, so teams build the function library and driver script themselves.
* [Robot Framework](https://robotframework.org/) – an open-source engine designed around keywords, with tabular syntax and many ready-made keywords.
* [TestNG](https://www.guru99.com/testng-tutorial.html) – commonly used alongside Selenium to sequence keyword-mapped methods and generate reports.

Our list of [automated testing tools](https://www.guru99.com/automated-testing-tools.html) covers licensing and platform support for each option.

## FAQs

🤖 Can AI generate the keywords and the function library for me?

AI assistants can draft keyword names from user stories and scaffold the matching [Selenium](https://www.guru99.com/selenium-tutorial.html) methods, which removes most of the setup typing. A human must still confirm the business vocabulary and validate every generated locator before the suite is trusted.

🧠 Does AI self-healing remove the object repository problem?

It reduces it rather than removing it. Self-healing engines re-identify an element from surrounding attributes when a locator breaks, cutting routine repairs. Repository governance is still needed, because a healed locator that silently matches the wrong element hides a real defect.

📗 Is Keyword Driven Testing the same as BDD?

No. Both hide code behind readable steps, but BDD tools such as [Cucumber](https://www.guru99.com/cucumber-tutorials.html) use Given-When-Then sentences written for collaboration on requirements. Keyword driven tests use tabular action words written for reuse inside the automation suite.

🔢 How many keywords should a framework contain?

Keep the vocabulary as small as the application allows, typically a few dozen low-level actions plus one high-level keyword per business flow. If two keywords describe the same action, merge them immediately; duplicates are what make libraries unmaintainable.

🔄 Can keyword driven tests run inside a CI/CD pipeline?

Yes. Commit the keyword sheets to version control alongside the function library, then let the build server invoke the driver script. Runners such as [TestNG](https://www.guru99.com/testng-tutorial.html) handle grouping and reporting, so failures surface in the same build report as unit tests.

#### Summarize this post with:

ChatGPT Perplexity Grok Google AI 

**Stay Updated on AI** **Get Weekly AI Skills, Trends, Actionable Advice.** 

##### Sign up for the newsletter

Subscribe for Free 

You have successfully subscribed.  
Please check your inbox. 

![AI-Newsletter](https://www.guru99.com/images/footer-email-avatar-imges-1.png) Chosen by over **350,000+** professionals 

[Scroll to top ](#wrapper)Scroll to top 

× 

Toggle Menu Close 

Search for: 

Search

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.guru99.com/#organization","name":"Guru99","sameAs":["https://www.facebook.com/Guru99Official","https://twitter.com/guru99com"],"logo":{"@type":"ImageObject","@id":"https://www.guru99.com/#logo","url":"https://www.guru99.com/images/guru99-logo-v1-150x59.png","contentUrl":"https://www.guru99.com/images/guru99-logo-v1-150x59.png","caption":"Guru99","inLanguage":"en-US"}},{"@type":"WebSite","@id":"https://www.guru99.com/#website","url":"https://www.guru99.com","name":"Guru99","publisher":{"@id":"https://www.guru99.com/#organization"},"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https://www.guru99.com/images/keyword-driven-testing-framework.png","url":"https://www.guru99.com/images/keyword-driven-testing-framework.png","width":"700","height":"250","caption":"Keyword Driven Testing Framework","inLanguage":"en-US"},{"@type":"BreadcrumbList","@id":"https://www.guru99.com/keyword-driven-testing.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":"1","item":{"@id":"https://www.guru99.com","name":"Home"}},{"@type":"ListItem","position":"2","item":{"@id":"https://www.guru99.com/softwaretesting","name":"Software Testing"}},{"@type":"ListItem","position":"3","item":{"@id":"https://www.guru99.com/keyword-driven-testing.html","name":"Keyword Driven Testing Framework with Example"}}]},{"@type":"WebPage","@id":"https://www.guru99.com/keyword-driven-testing.html#webpage","url":"https://www.guru99.com/keyword-driven-testing.html","name":"Keyword Driven Testing Framework with Example","dateModified":"2026-07-28T17:35:31+05:30","isPartOf":{"@id":"https://www.guru99.com/#website"},"primaryImageOfPage":{"@id":"https://www.guru99.com/images/keyword-driven-testing-framework.png"},"inLanguage":"en-US","breadcrumb":{"@id":"https://www.guru99.com/keyword-driven-testing.html#breadcrumb"}},{"@type":"Person","@id":"https://www.guru99.com/author/thomas","name":"Thomas Hamilton","description":"I am Thomas Hamilton, a seasoned professional in software testing, specializing in crafting comprehensive guides to help you master your software testing skills.","url":"https://www.guru99.com/author/thomas","image":{"@type":"ImageObject","@id":"https://www.guru99.com/images/thomas-hamilton-author-v2-120x120.png","url":"https://www.guru99.com/images/thomas-hamilton-author-v2-120x120.png","caption":"Thomas Hamilton","inLanguage":"en-US"},"worksFor":{"@id":"https://www.guru99.com/#organization"}},{"articleSection":"Software Testing","headline":"Keyword Driven Testing Framework with Example","description":"KEYWORD-DRIVEN TESTING is a scripting technique that uses data files to contain the keywords related to the application being tested. These keywords describe the set of actions that is required to perform a specific step.","keywords":"testing","speakable":{"@type":"SpeakableSpecification","cssSelector":[".entry-title",".summary"]},"@type":"Article","author":{"@id":"https://www.guru99.com/author/thomas","name":"Thomas Hamilton"},"dateModified":"2026-07-28T17:35:31+05:30","image":{"@id":"https://www.guru99.com/images/keyword-driven-testing-framework.png"},"copyrightYear":"2026","name":"Keyword Driven Testing Framework with Example","subjectOf":[{"@type":"FAQPage","mainEntity":[{"@type":"Question","name":"Can AI generate the keywords and the function library for me?","acceptedAnswer":{"@type":"Answer","text":"AI assistants can draft keyword names from user stories and scaffold the matching Selenium methods, which removes most of the setup typing. A human must still confirm the business vocabulary and validate every generated locator before the suite is trusted."}},{"@type":"Question","name":"Does AI self-healing remove the object repository problem?","acceptedAnswer":{"@type":"Answer","text":"It reduces it rather than removing it. Self-healing engines re-identify an element from surrounding attributes when a locator breaks, cutting routine repairs. Repository governance is still needed, because a healed locator that silently matches the wrong element hides a real defect."}},{"@type":"Question","name":"Is Keyword Driven Testing the same as BDD?","acceptedAnswer":{"@type":"Answer","text":"No. Both hide code behind readable steps, but BDD tools such as Cucumber use Given-When-Then sentences written for collaboration on requirements. Keyword driven tests use tabular action words written for reuse inside the automation suite."}},{"@type":"Question","name":"How many keywords should a framework contain?","acceptedAnswer":{"@type":"Answer","text":"Keep the vocabulary as small as the application allows, typically a few dozen low-level actions plus one high-level keyword per business flow. If two keywords describe the same action, merge them immediately; duplicates are what make libraries unmaintainable."}},{"@type":"Question","name":"Can keyword driven tests run inside a CI/CD pipeline?","acceptedAnswer":{"@type":"Answer","text":"Yes. Commit the keyword sheets to version control alongside the function library, then let the build server invoke the driver script. Runners such as TestNG handle grouping and reporting, so failures surface in the same build report as unit tests."}}]}],"@id":"https://www.guru99.com/keyword-driven-testing.html#schema-1153600","isPartOf":{"@id":"https://www.guru99.com/keyword-driven-testing.html#webpage"},"publisher":{"@id":"https://www.guru99.com/#organization"},"inLanguage":"en-US","mainEntityOfPage":{"@id":"https://www.guru99.com/keyword-driven-testing.html#webpage"}}]}
```
