Monday, 10 February 2014

QTP Frame Works

What is Frame Work? It is set of Assumptions or Concepts. Different Type of Frame Works are There. 1. Data Driven Frame Work 2. BPT Framewor... thumbnail 1 summary
What is Frame Work?
It is set of Assumptions or Concepts.

Different Type of Frame Works are There.

1. Data Driven Frame Work
2. BPT Framework
2. Keyword Driven Frame Work
3. Hybrid Driven Frame Work

2.1 Simple Keyword Driven Frame Work

Example: 1. Open the Login WebPage 2. Enter User ID & Passsword, Click Sign in to enter into the Login Page 3. after find the Logout button click on that logout link.
Step 1:
Step 2:
Step 3:   
Step 4: Click Sign Out it will come to the Home page Login


It is a concept to execute the Process.
How to Create?
Step 1: Create each and every reusable component.
For this Create the Library <folder> store in this all .vbs files
Step 2: Create separately each and every Object Repositories.
For this Create the ObjectRepository <folder> all the repository .tsr files copy in this folder
Step 3: associate all the .vbs files and objct Repository .tsr to Driver1 Script.
For this Create the Driver <folder> store the Driver Script in this folder
After open the qtp open this driver folder fist then run this test.
Step 4: Open the Data Table in QTP
Step 5: Write the Driver Script for calling all the tests through the Key Variable
Launch.vbs
Function launch_app()
SystemUtil.Run "IEXPLORE.EXE", http://192.168.1.70:3000/Test_Projec
End Function

Login.vbs
Function login()
Browser("Header").Page("Header").WebEdit("userid1").Set "admin"
Browser("Header").Page("Header").WebEdit("pwd1").SetSecure "4f3f5cb824f8c09eb07fd80459f9"
Browser("Header").Page("Header").WebButton("Sign in").Click
End Function
Close.vbs
Function Close_app()
Browser("Header").Page("Header_2").Link("Sign Out").Click
Browser("Header").Close
End Function

QTP Test file name: Driver1
Write Driver1 Script:
Here Associate all the .vbs files and .tsr files to this QTP Driver1 Test
Dim Var
Var = DataTable.Value ("key",dtGlobalSheet)
Select Case Var
Case "la" launch_app()
Case "ln" login()
Case "ca" Close_app()
End Select
Note: Without Calling function Directly execute all the reusable components.
Take the Key Variables in the QTP Data Table in QTP Driver Test:
View --> Data Table

Ex: Key is a User Defined Variable

Associate all each and every .vbs files to the Driver Script:
Call the Tests: Open the Drive Script
File >> Settings >> Resources >> Associate all .vbs files here. (Launch.vbs, Login.vbs, Close.vbs)
Note: if Create all .vbs files without descriptive programming. So here after associate the all .vbs files and also associate all the repository files to Driver1 test.
How to Associate all repository files to the driver Script:
Login.tsr, Logout.tsr
Resource >> Associate Repositories à Click + button to add the Repository Select that test available action >> Click > button to associate the repository >> Click Ok button. Like this associate all the repositories.
Run> Drive1 Test
How to execute the Test:
Step1. In Data Table Take Key Variable
Step2. Execute that respective key associated function
Step3. Increment the Row automatically take the next key Variable and execute that respective key associated function and so … on execute remaining key variables if any next.
2.2 Advanced Keyword Driven Frame Work


TestCases sheet in Test.xls This file store in the TestData 

TCID Description Module Result
-------------------------------------------------------
TC001
TC002
TC003


TestSteps sheet in Test.xls

TCID TSID Description Keyword Result

TC001 TS001
TC001 TS002
TC001 TS003

TC002 TS001
TC002 TS002
TC002 TS003

TC003 TS001
TC003 TS002
TC003 TS003
'Driver Script: QTP Driver File This file store in Libraray 



Run the Tests:

Open the Driver Script file
Press Run Button.

What is the Frame Work in QTP?
How many types of Frame Works are there in QTP?

What is the Data Driven Frame Work?
Click the following to see with the Live Example 

What is the Keyword Driven Frame Work?
Click the following to see with the Live Example

What is the Hybrid Driven Frame Work?
Click the following to see with the Live Example 

Data Driven Framework:
What is Data Driven?
What is Data Driven Frame Work?
Why Using Data Driven Frame Work in QTP Frame Works Give the Complete Example?


Keyword Driven Framework:
Live Example l: Here Using Simple Keyword Driven Frame Work with Flight Application.
Live Example 2: Here Using Simple Keyword Driven Frame Work with Flight Application.


Hybrid Driven Framework:
Live Example 1: Use the FA
Live Example 2: Use the Web Application

No comments

Post a Comment