Header Ads

What is Keyword Driven Framework??

With the advancement of automation framework, after record and playback ,Keyword driven framework is the most robust and acceptable framework while automating huge testcases.

It is true that sometimes,if we change the approach , we may get more bugs via automation.Breadth over depth approach to testcase automation gives more bugs. Instead covering all features ,it is better to go for a specific features covering all the objects. There should be a balanced approach for selecting depth and breadth testing.

The more the framework easy to use ,more and more test engineers will jump into automation that will intern increase the coverage and testcase count.Automation will never face the starvation issue as there will be plenty of test cases to automate.

This framework is an application independent way to design testcases. The testcases are supported via data table. Mostly a database supports the vocabulary of keywords.A core library is required to read all these lines from Excel or data source and convert them into equvalent QTP /Selenium/other tool command.

The keywords are simple and clear [like open_bowser,Close_browser,setValue].Each keyword will be mapped to a known action.There can be multiple inputs for the action. Like -Locator,Text. Even an action can be an input to another action.Now this framework is combination of tables[Cycle table,test table]. Below are the sections where I have shown how is the structure of a keyword driven framework...

In keyword driven testing there exists five different parts..

  1. Control file
  2. Testcase file
  3. Startup Script
  4. Driver Script
  5. Utility Script
What is Control File?
Well, this file contains all testcases. Based on some parameters or conditions some of the testcases will be executed.
What is Testcase File?
Detailed design  test cases.Mainly written column like-Keyword ,Object Name , Parameters.It is an excel file in most of the cases.This will also include the start up and tear down methods.
What is Startup Script?
This is the initialization script. It creates the environment to run the testcases.Assembles the testcases those are marked to be runable in control file.
What is Driver Script?
It drives the test flow,gets input from stratup script [Which scripts to run]. It reads the testcase file for the corresponding steps. It takes the input passes that to script engine to generate the code according to the test tool and corresponding script gets executed.
A good framework should allow any combination of features to be tested. Initial days we used Excel to select testcases.As technology progressed,we use web interfaces with simple UI where check box can be checked to select testcases.User friendly,self explanatory web interface ensures good productivity as it reduces the technical barriers.Jenkins,QC are very good example.  This feature will support mini regression to full regression.
What is Script Engine or Utility Script?
Script engine is responsible for tool specific code generator. Kind of tool understandable code generator. The code will be executed on the tool.
Utility script: Utility Scripts are the low level test steps to perform some operation.Some common utility methods are-

  • LaunchApplication
  • CallScript
  • ReportLog- It is also known for debug logger. It gives more clarity on real bug and noice.

Sometimes all supported libraries we put in Utility Script.like-

  • File Handling,
  • String handling
  • Database access
Execute -Execute and Execute should be main aim for this approach. This is keep the maintenance low and scripts updated. This will give great ROI.
There may or may not be any object repository present. There is further reusable concept hence all functions, keywords etc will be generic in nature.
  • Change management is easier
  • Does not dependent on the UAT
  • Much easier to extend.
  • Similar to functional test script so easy for non technical or non tool experts in terms of understanding.It is easy for them to develop scripts.
  • When developed block by block it becomes highly user friendly.Real power of functional decomposition can be seen. 
  • This will also cut down the test engineers tedious and lengthy testcase creation time. Manual testers will have  bugs.
  • Easy to modify so maintenance cost is low with compared to other framework.So greater ROI could be achieved.
  • Advanced keyword driven framework is having two layers…one is pure code layer and other is pure English or non code elite language.Functional people can prepare the test cases very easily.
  • If the infrastructure is separated from logical layer then any test cases can be automated.
  • After a couple of months when the basic building blocks(unique components) are ready to design  a functional flow, the development cost will down.
  • So this will provide better ROI.
  • If application is getting changed, it can determine the changes on run time .It can change only that component.No need to debug the entire script. Hence it is very easy to maintain.

Due to simple English interface, it is best for manual test engineers,functional analysts and business analysts.

  • Naming convention is tough for large projects.
  • Very tough to remember the keywords.
  • Initial investment for framework design is high.
  • High skilled labor is must for initial days of the project.
  • Not very to understand for new comers.
So to conclude, it is one of the finest flavor of data driven testing but having most time consuming process.But the keyword preparation is one time effort. Once completed,it can handle any size of project.This approach will uncover the code issues in an automation at earliest. Automation code is also a software code that needs to be tested.By this approach,we can test automation code as well.As a result it is more likely to uncover more bugs.
image credit :cdn2.codenutz.com
Powered by Blogger.