What is Keyword Driven Framework and How it works ? - TestingQ.com

-->Exclusive Portal for Testing Jobs

What is Keyword Driven Framework and How it works ?

Keyword Driven Framework is a type of QTP Framework where for a particular test case, you would first identify a set of Keywords and then associate an action (or function) which each of these keywords.

Let us understand this concept with the help of an example. Let us consider that you have to automate a flow where you would need to do the following things in GMail.

1) Login to GMail.
2) Count the number of unread emails in Inbox.
3) Logout from GMail.

Now, let’s see how we can approach this test case from Keyword Driven Framework perspective. If you look at the above test case from pure Modular Framework point of view, you will be able to easily identify that you would need to write 3 different functions for the above test case. These 3 functions will be used to – Login to Gmail, count unread emails and logout.
Once you have identified the functions, the next step is to identify some keywords and then associate the functions with these keywords. Below figure shows a pictorial representation of this concept.

From the above image you can see that basically a Keyword Driven Framework is nothing but a collection of keywords & functions (or actions or operations) and the association between these two entities. So to create a keyword driven framework, all you have to do is -
a) identify keywords and store them somewhere,
b) create functions for the business flows, and
c)associate these functions with the keywords.

Frameworks where Keywords are associated with entire functions:

Example 1: This is one of the most common formats of Keyword Driven Frameworks that you will see around (with slight variations here and there). Here, you need to specify all the keywords against a test case. For ease of understanding, you would also need to provide a description for each of the keywords. The below image shows how the keyword excel sheet would look like.

Example 2: This is another common structure that is used very frequently and is quite similar to the previous one. The only difference is that the keyword names are self explanatory and hence you don’t need to provide the description for each keyword. The keywords can be arranged horizontally or vertically as per your wish. The below image shows the structure of the keyword excel sheet with horizontally aligned keywords.

Frameworks where Keywords are associated with the lowest level operation on an object
Example: As mentioned previously also, in this type of Keyword Driven Framework design, the keyword is associated with a small operation (like click button, set value in some text box) rather than associating it with an entire function (like login, logout etc). Also this is a framework design that is quite complex and used rarely. Image below shows the screenshot of Login component of Gmail.

In the above example, Set, Click and Sync are the keywords that will be associated with corresponding set, click and sync functions provided by QTP. All other functions will also be written in the same way in this framework design.

This is all about the basics of Keyword Driven Framework.

To receive daily posted JOBS & Interview Questions
Just enter your email address below and click 'Submit'
Enter your email address:

Make sure to activate your subscription by clicking on the activation link sent to your email