Tuesday, November 17, 2009

Types of Automation Frameworks

The primary heads that govern the definition of framework are:

1. Automated Test case design – or the test case flows
2. Testing tool used
3. Test Data Supply and Volume
4. Test Management
    a. Test Scripts’ structure and their storage
    b. Test Case/ Script Creation
    c. Execution
    d. Error logging
5. Defect Creation
6. Crash Recovery Scenarios
7. Reporting Mechanism

All these activities have to be clearly defined and taken care of by one or the other tool with or without user intervention. Not in all kinds of applications have all these automated. Some may require to be done manually depending on the environment and budget for the project.

Apart from the above, some of the attributes of application under test (AUT) also plays a role in selecting or designing a test automation framework. For example: technology of the application, ease with which an automation tool can interact with it, the type of front end and backend, etc. These will be specific to the AUT and can only be determined while working on it.

Test Automation framework can be classified into the following based on point #1 in conjunction with point # 3 in the list mentioned above.
  1. Simple Test Automation Framework
  2. Keyword Driven Framework
  3. Data Driven Framework
  4. Hybrid Framework

Simple Automation Framework:

A simple automation framework has the entire set of test cases or flows grouped into different scripts. The scripts will have a hierarchy and may be called by one another at different stages. The definition of the structure and interoperability of these scripts is fairly simple and may reside in a folder structure normally based on the hierarchy itself.

For convenience this can have commonly accessed code lines written as functions and stored into library files in another folder within the root structure.


This kind of framework is used when the test cases and their flows and the AUT itself are simple and easily manageable.

Keyword Driven:


This is also known as data table driven framework. The application under test will be supplied with the input data using the data table feature of QTP (quick test professional). The data table works just like an excel work sheet with rows and columns containing data pre entered by the user. QTP internally uses a keyword driven framework. The script concentrates on two things: objects and operations. An object can be a button, text edit, combo box, radio button, check box, etc. and an operation can be click, enter, set, select, etc. The operation examples mentioned here are the keywords defined in QTP. We do operations on different objects using keywords and the data is input to them in loop through the data table. For example form filling on a website includes these different fields and using QTP’s data table, multiple forms can be filled using a loop with variance of data saved in the data table. An example below shows this better. [Not in any computer language. This is for concept understanding only]

Loop Begin
 TextEdit.Enter “John Smith”
 RadioButton(“Male”).Select
Loop End

This can be written using data table as:

Loop Begin [Run for 2 times]
 TextEdit.Enter DataTable(“Name”)
 RadioButton(DataTable(“Sex”)).Select
Loop End

Data table can be like this:


Scripts can be created in keyword driven methodology mostly by recording the scripts and creating variance of data for the various operations. This can be the best approach when the users have less technical knowledge in expert mode scripting or need a quick automated script created to do a set of simple operations over and over again.

No comments: