What is a Framework:
Framework is the guidelines which we have to follow
while doing the Automation testing in proper way.
We have to create an Automation Framework Folder
Structure which contains below list of folders.
Object Repository
In OR folder we will save the .tsr files of our project
Function Libraries
Where we save our library files or .qfl files
Environment Variables
where we will save our environment variables
Test Data
in this folder we will save our test data files like
Excel sheet etc.
Actions
In this folder we will save the different actions for
different functionalities.
Driver Script
This is the common logic for entire automation
framework and all the resource files & test data will
drive to the UFT with this only.
Results
In this folder we will save the test execution results
with each and every step status along with screen
shots for failed steps.
Recovery Scenarios
In this folder we will save the recovery scenarios.
Types of Automation Frameworks :
We have 5 types of frameworks are there.
Linear Driven Framework
Modular Driven Framework
Data Driven Framework
Keyword Driven Framework
Hybrid Driven Framework [ combination of any
above2 frameworks]
Linear Driven Framework: This type of frameworks
is used for the application which is constant [stable]
or will not change the functionalities for long time.
in this framework we will record all the
functionalities and use them.
Modular Driven Framework:
This type of framework is used for the
applications which are having more modules in it.
Here we will maintain the Object Repositories in
module level.
Ex: for e-commerce and Banking applications
preferable
Data Driven Framework:
This type of framework is used for the
applications which are having the functionalities
that to be tested with multiple sets of data.
Ex: one functionality will be tested by different
sets of data.
Ex: Fund transfer in Bank application.
Keyword Driven Framework:
This type of frameworks is used for the
applications which are having parallel testing with
cross browser requirements.
We will use excel sheets in this framework.
Hybrid driven Framework:
Combination of any 2 frameworks is called Hybrid
framework.
Modular + Keyword
Modular + Data Driven
Keyword + Data Driven
'********************************** Keyword Driven
**************************************************************************
*****************
'Step 1
'*************Declaring Variables********************************
Msht="MODULE"
Tsht="TESTCASE"
Ksht="KEYWORD"
'***************************Adding Run time sheets to Datatable
Datatable.AddSheet Msht
Datatable.AddSheet Tsht
Datatable.AddSheet Ksht
Impsht="G:\Flight_Application\Test_Data\Test_Scripts.xls"
'This for Modules sheet
Datatable.ImportSheet Impsht,"Module",Msht
''This for Testcases sheet
Datatable.ImportSheet Impsht,"Testcase",Tsht
'This for Keywords sheet
Datatable.ImportSheet Impsht,"Keyword",Ksht
'Modules sheet rowcount
Mc=Datatable.GetSheet(Msht).GetRowCount
'Testcases sheet rowcount
Tc=Datatable.GetSheet(Tsht).GetRowCount
'Keyword sheet rowcount
Kc=Datatable.GetSheet(Ksht).GetRowCount
'Module Sheet Iteration
For M = 1 To Mc
Datatable.GetSheet(Msht).SetCurrentRow(M)
Mexe=Datatable("Execution",Msht)
If Mexe="Y" Then
Mmid=Datatable("Module_ID",Msht)
For T=1 To Tc
Datatable.GetSheet(Tsht).SetCurrentRow(T)
Texe=Datatable("Execution",Tsht)
Tmid=Datatable("Module_ID",Tsht)
If Tmid=Mmid and Texe="Y" Then
Ttcid=Datatable("Testcase_ID",Tsht)
' MsgBox Ttcid
Select Case Ttcid
Case "Tc001"
Call OpenApp
wait 5
Case "Tc002"
Call LoginApp
If Browser("Online Shopping Site for").Exist(5) = true Then
datatable("Results","Keyword") = "PASSED"
else
datatable("Results","Keyword") = "Failed"
End If
End Select
End if
Next
End if
Next
datatable.Exportsheet "G:\Flight_Application\Results\Results.xls",KEYWORD