Keyword driven testing in qtp

1,862 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,862
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
41
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Keyword driven testing in qtp

  1. 1. WWW.qtptesting.com Keyword Driven Testing Frame Work Using the Select … Case Statement Step 1: Step2:www.traininighub.in www.qtptesting.com
  2. 2. WWW.qtptesting.com 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 filesStep 2: Create separately each and every Object Repositories. For this Create the ObjectRepository<folder> all the repository .tsr files copy in this folderStep 3: associate all the .vbs files and objctRepository .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 QTPStep 5: Write the Driver Script for calling all the tests through the Key VariableLaunch.vbswww.traininighub.in www.qtptesting.com
  3. 3. WWW.qtptesting.comFunction launch_app()SystemUtil.Run "IEXPLORE.EXE",”Urls of site”End FunctionLogin.vbsFunction login()Browser("Header").Page("Header").WebEdit("userid1").Set "yourself"Browser("Header").Page("Header").WebEdit("pwd1").SetSecure"4f3f5cb824f8c09eb07fd80459f9"Browser("Header").Page("Header").WebButton("Sign in").ClickEnd FunctionClose.vbsFunction Close_app()Browser("Header").Page("Header_2").Link("Sign Out").ClickEnd FunctionQTP Test file name: Driver1Write Driver1 Script:Here associate all the .vbs files and .tsr files to this QTP Driver1 TestDim VarVar = DataTable.Value ("key",Gloabl)Select Case VarCase "la" launch_app()Case "ln" login()Case "ca" Close_app()End SelectNote: Without calling function directly execute all the reusable components.Take the Key Variables in the QTP Data Table in QTP Driver Test:View  Data Tablewww.traininighub.in www.qtptesting.com
  4. 4. WWW.qtptesting.comEx: Key is a User Defined VariableAssociate all each and every .vbs files to the Driver Script:Call the Tests: Open the Drive ScriptFile  Settings  Resources  Associate all .vbs files here.Launch.vbs, Login.vbs, Close.vbsNote: if Create all .vbs files without descriptive programming. So here afterassociate the .vbs files associate all the repository files also.Associate all repository files to the driver Script:Login.tsr, Logout.tsrResource  Associate Repositories  Click + button to add the Repository Selectthat test available action  Click > button to associate the repository  Click Okbutton. Like this associate all the repositories.Run> Drive1 TestHow to execute the Test:www.traininighub.in www.qtptesting.com
  5. 5. WWW.qtptesting.comStep1. In Data Table Take Key VariableStep2. Execute that respective key associated functionStep3. Increment the Row automatically take the next key Variable and executethat respective key associated function and so … on execute remaining keyvariables if any next.If Single File also execute: maintenance is difficult to execute the process forentire project.Function launch ()SystemUtil.Run "IEXPLORE.EXE", "Url of site"End FunctionFunction login()Browser("Header").Page("Header").WebEdit("userid1").Set "Yourself"Browser("Header").Page("Header").WebEdit("pwd1").SetSecure"4f3f5cb824f8c09eb07fd80459f9"Browser("Header").Page("Header").WebButton("Sign in").ClickEnd FunctionFunction logout()Browser("Header").Page("Header_2").Link("Sign Out").ClickEnd FunctionDim Varwww.traininighub.in www.qtptesting.com
  6. 6. WWW.qtptesting.comVar = DataTable.Value ("key",Gloabl)Select Case VarCase "a" launch()Case "b" login()Case "c" logout()End SelectWhat is Key?It is a Variable that assigns the reusable test. Using these keys to complete the endto end process.www.traininighub.in www.qtptesting.com

×