How to Achieve Test Optimization with Keyword Driven Framework

Keyword driven framework

The process in which the test cases are separated into four parts in order to differentiate coding from test cases and test steps for better automation are called keyword-driven frameworks. Segregated by a keyboard-driven testing framework, the test cases are divided into objects of test steps, data for test objects, test steps, and actions on test steps for better comprehension.

What is Keyword Driven Testing?

A scripting technique that involves data files to hold the keywords related to the application being tested is keyboard-driven testing. With the help of these keywords, we can describe the set of actions that have to perform a specific step. High and low-level keywords are included in a keyword revision test and they also comprise keyword arguments that are made up to describe the action of a test case, this process is called table-driven testing or action word-based testing. The initial step of keyword-driven testing would be to identify a group of keywords and then link a function or an action related to these keywords. Each and every testing action could be either opening or closing of the browser, or even a mouse click is described as a keyword such as an open browser click, etc.

What do you need for a keyword-driven framework?

  1. Excel Sheet– Identify the keywords and store in an Excel sheet.
  2. Data Sheets– The test data used in the application is stored in data sheets.
  3. Function Library– The functions of particular business flows is what a function library comprises of. Hence whenever a test is being performed it will read the keyword from Excel sheet. Then, the functions will be carried out accordingly.
  4. Test Scripts– We can have test scripts for every manual test case or a single driver script depending upon the design of the framework.
  5. Object Repository– An object repository is used based on the keyword driven framework being used.

Why use Keyword Driven Testing?

Keyword-driven testing is used in software engineering for the following reasons:

  1. The components that are common well handled by a standard library
  2. The amount of reusability is much higher
  3. With the help of keyword driven testing, a more abstract manner can be adopted in the way of writing tests.
  4. It is not necessary for the users to use the scripting languages.
  5. The script detail is not visible to the users.
  6. Hence the test is not only concise but it is also flexible as well as easily maintainable.

How to perform Keyword Driven Testing?

Usually, keyword-based testing is done with automated testing. But it can also be done manually as well as automated.

The main reasons why automated keyword-based testing is preferred are:

  1. Avoid duplicated specifications.
  2. Reduces maintenance cost.
  3. Portability and testing support is way better than manual testing.
  4. More amount of testing can be done with lesser effort.
  5. Function scripting can be reused efficiently.

Recording tests is the best way to compose keyword-driven testing. Once the test is done, you can modify and fix them if required. In the earlier stages of development, you can create a very simple functional test. It requires the help of keyboard revision testing which can help you in testing the application piece by piece.

Every keyword is linked with one command if not many or test scripts or functions. This carries forward the actions that are related to that keyword. A test automation framework ie is when the test cases are executed and these keywords are comprehended by a test library.

There are a few tools that I have been used widely in keyword-driven testing are HP QTP and Selenium.

There are a lot of benefits of Keyword Driven Testing; like how programming knowledge is not required to develop tests. And before the application is ready, functional testing can help prepare the final testing sequence. They are also compatible with any automation tools that are available in the market and are not dependent on any particular programming language or tool.

The most important steps included in keyword-driven testing are –

Step 1. Identifying both low-level and high-level keywords.
Step 2. Putting into effect the keywords as they can be implemented.
Step 3. Test case creation.
Step 4. Driver scripts creation.
Step 5. Automation test scripts have to be executed.