Sunday, 20 February 2011



Keyword Driven Testing Frame Work Using the                               Select … Case Statement

STEP1

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",”Urls of site”

End Function

Login.vbs           
Function login()

Browser("Header").Page("Header").WebEdit("userid1").Set "yourself"
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

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",Gloabl)

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

STEP 4

     

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 .vbs files associate all the repository files also.
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.


If Single File also execute: maintenance is difficult to execute the process for entire project.

Function launch ()
SystemUtil.Run "IEXPLORE.EXE", "Url of site"
End Function

Function login()
Browser("Header").Page("Header").WebEdit("userid1").Set "Yourself"
Browser("Header").Page("Header").WebEdit("pwd1").SetSecure "4f3f5cb824f8c09eb07fd80459f9"
Browser("Header").Page("Header").WebButton("Sign in").Click
End Function

Function logout()
Browser("Header").Page("Header_2").Link("Sign Out").Click
End Function

Dim Var

Var = DataTable.Value ("key",Gloabl)

Select Case Var
Case "a"  launch()
Case "b"  login()
Case "c"  logout()
End Select

What is Key?
It is a Variable that assigns the reusable test. Using these keys to complete the end to end process.


0 comments:

Post a Comment

TrainingHUB. Powered by Blogger.

Total Pageviews

THE BEST QTP TRAINING INSTITUTE IN HYDERABAD

QTP Training in hyderabad

Sql Tutorial

Popular Posts

Our Facebook Page

TrainingHUB

Followers