Wednesday, December 15, 2010

Keyword Driven Framework

Keyword:

1. Any word used as the key to a code

2 A reserved word used to identify a specific command, function etc.

(in our test automation example keywords are :

Keywords to be used in Test Automation:

a) Test Objects (EX: Browser,page,webEdit,WinButton---etc)

b) Functions (Built-In and User defined)

c) Methods (Ex:Set,Select,Activate,Navigate---etc)

d) Statements (EX:Dim,If,For---etc)

e) Operators (EX: +,/,*,and,or,not---etc)

Keyword Driven Approach:

In this approach we use keywords for preparing tests. First we create tests and make them as functions, through framework we execute them and generate results.

Key elements of Automation Framework:

1. Well defined folder structure

2. Initialization script

3. Driver script

4. input data spreadsheet

5. process guidelines document

Why folder structure?

In order to create, store, organize and manage files a well defined folder structure required. Folder structure is a mandatory element of any framework, but folder names may vary from one framework to another and company to another .

Folder Structure:

1. Object Repository

2. Environment

3. Library

a) Company

b) Project Specific

4. Test data

5. Test log

6. Recovery scenarios

7. Miscellaneous

And

1. Initialization script (.vbs file)

2. Driver script (QTP Script file)

1) Object Repository: In this folder we store object repository files(.tsr), all team members can use this repositories.

2) Environment: In this folder we store environment variables files(.xml), all team members can use this variables.

3) Function Library:this folder contains two sub folders one is for storing common functions of our company, another folder for storing our project specific functions(.vbs).

4) Test Data: in this folder we store test data required for data driven testing, for that we use either .xls files or .txt files or .mdb files.

5) Test Log: In this folder we store test result(excel sheet).

6) Recovery scenarios: In this folder we store qtp recovery scenarios files(.qrs).

7) Miscellaneous: in this folder we store the files other than above files(ex-process guideline doc and messages among team members and instructions by team lead etc).

And

1) Initialization script (.vbs file): It launches qtp tool and calls driver script, at end it closes qtp tool.

2) Driver script (QTP Script file): It is only the qtp script, we can associate all resources to this script.