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. For Example:

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

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

We will see some more example further in the article. Example of keywords In order to create a Keyword driven framework, you need following things

Excel Sheet– Identify the keywords and store them in an Excel sheet Function Library– Function library consist of the function for the business flows ( login button for any website).So when test is executed, it will read the keyword from the Excel sheet and call the functions accordingly Data Sheets– Data sheets is used to store the test data that will be used in the application Object Repository– based on your keyword driven framework you can use an object repository Test Scripts– Based on the design of your framework, you can have test scripts for each manual Test Case or a single driver script

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

How to perform Keyword Driven Testing

Keyword based 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 based 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 a simple functional tests in the earlier stages of development, testing the application piece-by-piece. The simplest way to compose keyword driven test is to record them. After recording, the test can be modified and customized as per the requirement. Each keyword needs to be linked with atleast one command, test scripts or function, which implement 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

Tools used for Keyword Driven Testing

Few tools which are extensively used for Keyword driven testing.

HP QTP Selenium

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

Sample test cases

TC_01: Login to guru99 demo site, find out how many transactions is carried out today TC_02: Login to guru99 demo site, send an email to one of your customer and then logout TC_03: Login to guru99 demo site and check for any notification received

Summary:

A keyword-driven testing is a scripting technique that uses data files to contain the keywords related to the application being tested A keyword-driven testing usually performed by automated testing. Tests can be developed without programming knowledge Tests are compatible with any automation tools available in the market