Frame Work is the model or structure we follow for a
Project. It is the approach that we follow to automate the
Project. There are so many types of framework in QTP.
1. Datadriven frame work
2. Keyword driven frame work
3. Module driven framework
4. Hybrid driven frame work
The framework you choose, depends on the model of your
Project. Usually most of projects fall under hybrid driven
Datadriven framework: Here we divide the entire project in
to modules and start automation by writing data driven
scripting for each one of them. We will have test data
either in excel sheet or flat files or from database...we
will pass that test data in to the script and perform data
Keyword driven framework:
Firstly we should add the objects to repository( Shared
repository is preferable)
Then we can generate/write scripts for each functionality
and save them as the library files ( .vbs files)
Then we have to associate all these library files(which are
generated to test different funtionalities) to Quick Test.
Module driven frame work: we will divide entire project in
to modules and write functions or procedures for each and
every module and automate the project.
Hybrid driven framework: it is combination of Datadriven
and module driven framework.
If you want more information about keyword driven framework
ask me thorugh our forums.
Framework: It is a procedure how we execute our scripts and
finally how we view the results, like how we create the
test scripts, functions libraries, repository files and
finally how we send the results to our lead or manager or
to the client.
"Keyword Driven Framework" consists of a folder structure.
Test Scripts are saved in "Test Scripts" folder
vbs files in "Library" folder
"Docs" Floder - Documentation for all the functions like
(Function Library, Function Name, Arguments, Description,
Author, Object Repository used)
Object Repository Files in "Object Repository" folder
"Reports", "Data" etc
Finally, we convert the "Results" in HTML format(Test
Results Window, File-->Export to HTML File
A framework is used for maintanance of test cases, recorded
scripts & actions, test data and test results in a central
repository or in form of folder structure. Framework saves
recorded scripts or scripts in expert view (by enhancing the
tests using custom checkpoints, regular expression)etc. and
make them resusable and generic which can be used again and
results can be compared by passing different set of data.
Modular Framework:- it is functional decomposition of
application modules. (business components).
It is table driven Framework which stores the object
parameters property and their values. It is used when a
Business function script runs and loads the test case,
corresponsing row in table is read and corresponding
function is called using the keyword from the table. The
business function script passes the parameter value (input
parameter) through either test data.xls or data table at run
session and returns the results in form of output parameters
to the test results folder or data table.This is called data
driven approach where scripts are parameterised through a
set of input and output values.
Hybrid Framework:- It is the highest level of framework
which encapsulates all approaches. It has various components:
Input Script for launching the qtp
i)Set reporting framework
ii)Set working area
iii)Set folder structures by reading the value of xml files
and setting them as global variable.
and other activities like giving control to controller script.
Main script for loading the list of test cases by reading
example a database file with ordering of test cases,
executes the test cases in either datatable by accessing
Output script for sending test results to test results folder.
Keyword-driven tests look very similar to manual test
cases. In a keyword-driven test, the functionality of the
application-under-test is documented in a table as well as
in step-by-step instructions for each test. In this method,
the entire process is data-driven, including functionality.
hi this is nagesh
framework: It is generic work prepared by group of experts followed test engineers to preform a specific task in an efficient, effective and optimized way.
keyword driven framework:
first we will preparing folder structure(env, lib, test data, repository, recovery, test script file).
and first we will manually prepare
env file: (by default qtp will create env file. env file extension .XML, (QTP>file settings>env>click>user define>EX-name:nages, value:path of the application>save>.xml)and export this env file in env file)
library file: first u will take notpad and u will prepare lib file lib file extension is .VBS
Test data: u will prepare test data
Test script: and u will genarating the basic script and u will split it and u will set reusabul and saved it)
recovery secnario: u will prapare recovery secnario
if possible u will prpare rgular expressions file
u will take new page
and u will set in datatable some name like keys in that column u will prepare some variables ex:k1, k2. k3
after u will write in expert view
and u will create select case andu will
associate lib file, ev file, recovery file,and
u will create case function and run
Framework : Framework is a defined process for re usability
of resources like libraries, object repositories, testcases,
e.t.c. And features(test plan,Re-usable test cases,
different format reports, e.t.c) that are associated in a
Keyword Driven Framework : Each atomic functionality is
identified in the AUT, written as small functions and named
meaningful. The framework is designed in a way that, we can
call the functions in the testcase excel sheets as a keyword.
Ex: ClickOnButton is a keyword for performing any click
operation on any kind of button.
Keyword-driven testing is a Software testing technique that
separates programming work from the actual test steps so
that the test steps can be developed earlier and can often
be maintained with only minor updates, even when the
application or testing needs change significantly.In case of
keyword driven testing, we need to do proper planning and
initial huge effort. Anyway it will give benefit of easy
maintenance and easily adding more test cases/scenarios.
As we see the keyword view in QTP, the keyword driven
testing involves specifying the test steps in below format
Object Action parameter
is the Object.
->”Set” is the Action.
->”QualityPoint” is the parameter.
Here we can change any of the three things to create test steps.
The Keyword Driven framework consists of the basic
components given below
1. Control File
2. Test Case File
3. Startup Script
4. Driver Script
5. Utility Script
1. Control File
a) Consists details of all the Test scenarios to be automated.
b) User will be able to select a specific scenario to
execute based on
turning on or off a flag in the Control File.
c) Control File is in the form of an excel worksheet and
for Scenario ID, Execute (Y/N), Object Repository Path, Test
2. Test Case File
a) Contains the detailed steps to be carried out for the
execution of a test
b) It is also in the form of an excel sheet and contains
Keyword, Object Name, Parameter
3. Startup Script
a) The Startup script is utilised for the initialization and
reads the control files.
b) It then calls the driver script to execute all the
scenarios marked for execution in the control file.
4. Driver Script
a) It Reads the Test Case files. Checks the keywords and
calls the appropriate utility script functions based on
b) Error Handling is taken care of in the driver script.
5. Utility Scripts
a) Perform generic tasks that can be used across applications.
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.
'import test case and test steps sheets from excel to data
'get row count from data table sheets
For i=1 to tcrows
If datatable.Value("Execute","dtSheet1")="Yes" Then
For j=1 to tsrows
Select Case datatable.Value("Keyword","dtSheet2")
If tsresult="Pass" Then