SlideShare a Scribd company logo
1 of 12
QTP Open Source Test Automation
Framework Implementation Guide

Version 1.1
May 2009




                                       DISCLAIMER
Verbatim copying and distribution of this entire article are permitted worldwide, without
royalty, in any medium, provided this notice is preserved.
Table of Contents



TABLE OF CONTENTS
1.   PURPOSE     OF THE   DOCUMENT ........................................ 3

2.   FRAMEWORK IMPLEMENTATION     IN   QTP ................................. 4
     2.1.       Test Settings for Keyword-driven Scripting ....................... 4
                2.1.1. Run Settings.............................................. 5
                2.1.2. Resources Settings........................................ 6
                2.1.3. Environment Tab Settings.................................. 7
     2.2.       Managing Object Repository ....................................... 8
     2.3.       Call to Framework ................................................ 9
     2.4.       Usage of Keywords ............................................... 10
     2.5.       Test Results for a Keyword-driven Script ........................ 11

3.   REFERENCES .................................................. 12




Open2Test.org                                                      Page ii
QTP Open Source Test Automation Framework
                                                       Implementation Guide


1.         Purpose of the Document
           This document provides an overview of the prerequisites and settings
           required to implement the Keyword-driven Framework in HP QuickTest
           Professional (QTP).




Open2Test.org                                                  Page 3
QTP Open Source Test Automation Framework
                                                            Implementation Guide


2.         Framework Implementation in QTP
           The Keyword-driven Framework is an application independent framework
           that performs all possible actions and verifications on an object.
           Hence, the code for the same object can be used across different
           applications.

2.1.       Test Settings for Keyword-driven Scripting
           In the keyword-driven approach the entire script is developed with
           keywords. The script is developed in a spreadsheet that is
           interpreted by the main driver script, which then uses the function
           library to execute the complete script.
           The QTP Settings.vbs file can be used to easily perform the test
           settings that are needed before proceeding with the Keyword-driven
           Scripting. This file associates the Function libraries, recovery
           scenarios, Environment Variables and the Object Repository files that
           are needed for a script.
           The QTP Settings file needs to be customized before usage. Edit the
           .vbs file in notepad and make the necessary changes (mentioned below)
           in the ‘Input Data’ section of the file.
                1. Function Libraries – Specify the path where the Framework
                   Files, Common Functions and the User Defined Functions are
                   stored.
                2. Recovery Scenario File - Specify the path of the file where the
                   Recovery scenarios are placed.
                3. Recovery Scenarios Name - Specify the names of the Recovery
                   scenarios that need to be associated to the test script.
                4. Environment File - Specify the path of the xml file for the
                   Global Environment Variables.
                5. Object Repository     files   -   Specify   the   path   of   the     Object
                   Repository.
           Open the test script in QTP for which the settings are needed and
           double click on the QTP Settings.vbs file. This file will perform the
           preferred settings automatically.

        If there are multiple items of libraries, object repositories or global variables file,
        they can be specified as an array separated by ‘,’



        Set the Flag envi_flag, recover_flag, repos_flag, library_flag to        "Yes"    if   the
        corresponding files need to be associated to test, Else set it to "no"




Open2Test.org                                                               Page 4
QTP Open Source Test Automation Framework
                                                              Implementation Guide

   Given below is a sample “QTP Settings”.
    libraries= array ("C:WebFramework.vbs","C:common functions.vbs")
    recovery_file= "C:recover.qrs"
    recovery_name=array("Scenario1","Scenario2")
    environment_file= "C:Environment.xml"
    repository_name= array ("C:repository1.tsr","C:repository2.tsr")

    'NOTE: Please set the Flag to "Yes" if the files are to be associated to
    test, otherwise set it to "no"
    envi_flag="yes"
    recover_flag=" yes"
    repos_flag=" yes"
    library_flag=" yes"



         There should be just one Recovery file which holds all the Recovery scenarios. Multiple
         Recovery files cannot be used.
         There should be no unsaved tests currently open in QTP. The test script for which the test
         settings need to be done should be open in QTP.



2.1.1.     Run Settings

           In the Run tab of the Test Settings dialog,
           1. The Run one iteration only radio button will be selected.
           2. The Disable Smart Identification during the run session check box
              will be checked.
           3. The Object       Synchronization      timeout    value    will   be   set   as   20
              seconds.




Open2Test.org                                                                  Page 5
QTP Open Source Test Automation Framework
                                                         Implementation Guide

                                  Figure 1: Run Settings


2.1.2.     Resources Settings

           After the run settings are completed, the QTP Settings file
           associates the framework with the test script. Here, the path and the
           names of the framework files need to be specified in the QTP Settings
           file. The framework will be taken from the location specified and
           associated with the test as shown below.




                          Figure 2: Associating Framework File

NOTE: The Common functions file and the User defined functions file should be
associated with the test only if needed by the test script.




Open2Test.org                                                    Page 6
QTP Open Source Test Automation Framework
                                                           Implementation Guide




2.1.3.     Environment Tab Settings

           QTP can insert a value from the environment variable list, which is a
           list of variables and corresponding values that can be accessed from
           the test. Throughout the test run, the value of an environment
           variable remains the same, regardless of the number of iterations,
           unless the value of the variable is changed programmatically in the
           script.
           Associating the user-defined Environment Variables file with the test
           is also handled by the QTP Settings file. The Environment Variables
           file with an .xml file type will be taken from the path specified in
           the QTP Settings file and associated with the test.




                      Figure 3: Loading Environment Variables from xml File




Open2Test.org                                                             Page 7
QTP Open Source Test Automation Framework
                                                         Implementation Guide




2.2.       Managing Object Repository
           After the test settings are completed, the QTP Settings file
           continues to associate the specified shared object repositories with
           the test. The objects from the shared repository will be uploaded and
           made available for the tests.




                            Figure 4: Associate Repositories Dialog




Open2Test.org                                                         Page 8
QTP Open Source Test Automation Framework
                                                        Implementation Guide




2.3.       Call to Framework
           The call to Keyword_Driver() needs to be specified in the Expert View
           as shown below. This will call the Framework file associated with the
           test and perform the actions by interpreting the keywords specified
           in the data table.




                                 Figure 5: Call to Framework




Open2Test.org                                                   Page 9
QTP Open Source Test Automation Framework
                                                         Implementation Guide




2.4.       Usage of Keywords
           The keywords should be entered in the global sheet of the data table
           of the test according to the syntax. To access the data table, choose
           View > Data Table or click on the            toolbar button. Below is an
           example of Keyword-driven Scripting.




                          Figure 6: Using the keyword in a Data Table




Open2Test.org                                                           Page 10
QTP Open Source Test Automation Framework
                                                        Implementation Guide

2.5.       Test Results for a Keyword-driven Script
           Test execution results can be viewed and analyzed as soon as the run
           session ends. To access the test results, choose Automation > Results
           or click on the         toolbar button. The results window will be
           displayed.




                               Figure 7: Results in QTP




Open2Test.org                                                   Page 11
QTP Open Source Test Automation Framework
                                                           Implementation Guide


3.          References
            HP QuickTest Professional Help documentation




COPYRIGHT
This library is free software; you can redistribute it and/or modify it under the terms of
the GNU Library General Public License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Library General Public License for more details.




Open2Test.org                                                            Page 12

More Related Content

What's hot

Rowan: A new project/package manager
Rowan: A new project/package managerRowan: A new project/package manager
Rowan: A new project/package manager
ESUG
 

What's hot (7)

API Performance Testing
API Performance TestingAPI Performance Testing
API Performance Testing
 
Rowan: A new project/package manager
Rowan: A new project/package managerRowan: A new project/package manager
Rowan: A new project/package manager
 
Intro to Testing in Zope, Plone
Intro to Testing in Zope, PloneIntro to Testing in Zope, Plone
Intro to Testing in Zope, Plone
 
How To Diffuse
How To DiffuseHow To Diffuse
How To Diffuse
 
Ensuring Software Quality Through Test Automation- Naperville Software Develo...
Ensuring Software Quality Through Test Automation- Naperville Software Develo...Ensuring Software Quality Through Test Automation- Naperville Software Develo...
Ensuring Software Quality Through Test Automation- Naperville Software Develo...
 
In the Brain of Hans Dockter: Gradle
In the Brain of Hans Dockter: GradleIn the Brain of Hans Dockter: Gradle
In the Brain of Hans Dockter: Gradle
 
Postman quick-reference-guide 2021
Postman quick-reference-guide 2021Postman quick-reference-guide 2021
Postman quick-reference-guide 2021
 

Viewers also liked (6)

Selection guidelines for_petrol_diesel_retail_6_sep_11
Selection guidelines for_petrol_diesel_retail_6_sep_11 Selection guidelines for_petrol_diesel_retail_6_sep_11
Selection guidelines for_petrol_diesel_retail_6_sep_11
 
Melity site automation [temp_results]5
Melity site automation [temp_results]5Melity site automation [temp_results]5
Melity site automation [temp_results]5
 
Selection guidelines for_petrol_diesel_retail_6_sep_11
Selection guidelines for_petrol_diesel_retail_6_sep_11 Selection guidelines for_petrol_diesel_retail_6_sep_11
Selection guidelines for_petrol_diesel_retail_6_sep_11
 
Ksk guidelines 050312
Ksk guidelines 050312Ksk guidelines 050312
Ksk guidelines 050312
 
The Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post FormatsThe Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post Formats
 
The Outcome Economy
The Outcome EconomyThe Outcome Economy
The Outcome Economy
 

Similar to ssssssssss

Automation framework123
Automation framework123Automation framework123
Automation framework123
subbusjune22
 
Testing implementation kel 11
Testing implementation kel 11Testing implementation kel 11
Testing implementation kel 11
Luthfia Ulinnuha
 
Qtp interview questions
Qtp interview questionsQtp interview questions
Qtp interview questions
Ramu Palanki
 
Qtp interview questions
Qtp interview questionsQtp interview questions
Qtp interview questions
Ramu Palanki
 
Qtp material for beginners
Qtp material for beginnersQtp material for beginners
Qtp material for beginners
Ramu Palanki
 
Qtp Basics
Qtp BasicsQtp Basics
Qtp Basics
mehramit
 

Similar to ssssssssss (20)

Automation Framework 042009 V2
Automation Framework   042009  V2Automation Framework   042009  V2
Automation Framework 042009 V2
 
Hybrid framework
Hybrid frameworkHybrid framework
Hybrid framework
 
Automation framework123
Automation framework123Automation framework123
Automation framework123
 
Qtp-training A presentation for beginers
Qtp-training  A presentation for beginersQtp-training  A presentation for beginers
Qtp-training A presentation for beginers
 
Automation Framework 042009 V2
Automation Framework   042009  V2Automation Framework   042009  V2
Automation Framework 042009 V2
 
Integration Group - Robot Framework
Integration Group - Robot Framework Integration Group - Robot Framework
Integration Group - Robot Framework
 
Basics of QTP Framework
Basics of QTP FrameworkBasics of QTP Framework
Basics of QTP Framework
 
Qtp basic
Qtp basicQtp basic
Qtp basic
 
QTP Basics-2
QTP Basics-2QTP Basics-2
QTP Basics-2
 
Testing implementation kel 11
Testing implementation kel 11Testing implementation kel 11
Testing implementation kel 11
 
Qtp interview questions
Qtp interview questionsQtp interview questions
Qtp interview questions
 
Qtp interview questions
Qtp interview questionsQtp interview questions
Qtp interview questions
 
Qtp material for beginners
Qtp material for beginnersQtp material for beginners
Qtp material for beginners
 
Qtp faqs
Qtp faqsQtp faqs
Qtp faqs
 
Spring 3.1 and MVC Testing Support
Spring 3.1 and MVC Testing SupportSpring 3.1 and MVC Testing Support
Spring 3.1 and MVC Testing Support
 
Hp Quick Test Professional
Hp Quick Test ProfessionalHp Quick Test Professional
Hp Quick Test Professional
 
Some useful tips with qtp
Some useful tips with qtpSome useful tips with qtp
Some useful tips with qtp
 
Performance testing checklist.pdf
Performance testing checklist.pdfPerformance testing checklist.pdf
Performance testing checklist.pdf
 
Test automation principles, terminologies and implementations
Test automation principles, terminologies and implementationsTest automation principles, terminologies and implementations
Test automation principles, terminologies and implementations
 
Qtp Basics
Qtp BasicsQtp Basics
Qtp Basics
 

Recently uploaded

如何办理伦敦商学院毕业证(LBS毕业证)毕业证成绩单原版一比一
如何办理伦敦商学院毕业证(LBS毕业证)毕业证成绩单原版一比一如何办理伦敦商学院毕业证(LBS毕业证)毕业证成绩单原版一比一
如何办理伦敦商学院毕业证(LBS毕业证)毕业证成绩单原版一比一
avy6anjnd
 
Abortion pills Dubai (+918133066128) Cytotec 200mg pills UAE Abudhabi
Abortion pills Dubai (+918133066128) Cytotec 200mg pills UAE AbudhabiAbortion pills Dubai (+918133066128) Cytotec 200mg pills UAE Abudhabi
Abortion pills Dubai (+918133066128) Cytotec 200mg pills UAE Abudhabi
Abortion pills in Kuwait Cytotec pills in Kuwait
 
如何办理新西兰林肯大学毕业证(Lincoln毕业证书)成绩单原版一比一
如何办理新西兰林肯大学毕业证(Lincoln毕业证书)成绩单原版一比一如何办理新西兰林肯大学毕业证(Lincoln毕业证书)成绩单原版一比一
如何办理新西兰林肯大学毕业证(Lincoln毕业证书)成绩单原版一比一
opyff
 
John Deere Tractors 5415 Diagnostic Repair Service Manual.pdf
John Deere Tractors 5415 Diagnostic Repair Service Manual.pdfJohn Deere Tractors 5415 Diagnostic Repair Service Manual.pdf
John Deere Tractors 5415 Diagnostic Repair Service Manual.pdf
Excavator
 
一比一原版(UdeM学位证书)蒙特利尔大学毕业证学历认证怎样办
一比一原版(UdeM学位证书)蒙特利尔大学毕业证学历认证怎样办一比一原版(UdeM学位证书)蒙特利尔大学毕业证学历认证怎样办
一比一原版(UdeM学位证书)蒙特利尔大学毕业证学历认证怎样办
ezgenuh
 
一比一原版西安大略大学毕业证(UWO毕业证)成绩单原件一模一样
一比一原版西安大略大学毕业证(UWO毕业证)成绩单原件一模一样一比一原版西安大略大学毕业证(UWO毕业证)成绩单原件一模一样
一比一原版西安大略大学毕业证(UWO毕业证)成绩单原件一模一样
wsppdmt
 
Top profile Call Girls In Thrissur [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Thrissur [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Thrissur [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Thrissur [ 7014168258 ] Call Me For Genuine Models ...
nirzagarg
 
Top profile Call Girls In dewas [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In dewas [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In dewas [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In dewas [ 7014168258 ] Call Me For Genuine Models We ...
gajnagarg
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN ABUDHABI,DUBAI MA...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN ABUDHABI,DUBAI MA...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN ABUDHABI,DUBAI MA...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN ABUDHABI,DUBAI MA...
Health
 
一比一原版(PU学位证书)普渡大学毕业证学历认证加急办理
一比一原版(PU学位证书)普渡大学毕业证学历认证加急办理一比一原版(PU学位证书)普渡大学毕业证学历认证加急办理
一比一原版(PU学位证书)普渡大学毕业证学历认证加急办理
ezgenuh
 
如何办理(爱大毕业证书)爱丁堡大学毕业证成绩单留信学历认证真实可查
如何办理(爱大毕业证书)爱丁堡大学毕业证成绩单留信学历认证真实可查如何办理(爱大毕业证书)爱丁堡大学毕业证成绩单留信学历认证真实可查
如何办理(爱大毕业证书)爱丁堡大学毕业证成绩单留信学历认证真实可查
huxs9sacp
 

Recently uploaded (20)

01552_14_01306_8.0_EPS_CMP_SW_VC2_Notebook.doc
01552_14_01306_8.0_EPS_CMP_SW_VC2_Notebook.doc01552_14_01306_8.0_EPS_CMP_SW_VC2_Notebook.doc
01552_14_01306_8.0_EPS_CMP_SW_VC2_Notebook.doc
 
如何办理伦敦商学院毕业证(LBS毕业证)毕业证成绩单原版一比一
如何办理伦敦商学院毕业证(LBS毕业证)毕业证成绩单原版一比一如何办理伦敦商学院毕业证(LBS毕业证)毕业证成绩单原版一比一
如何办理伦敦商学院毕业证(LBS毕业证)毕业证成绩单原版一比一
 
John deere 7200r 7230R 7260R Problems Repair Manual
John deere 7200r 7230R 7260R Problems Repair ManualJohn deere 7200r 7230R 7260R Problems Repair Manual
John deere 7200r 7230R 7260R Problems Repair Manual
 
Abortion pills Dubai (+918133066128) Cytotec 200mg pills UAE Abudhabi
Abortion pills Dubai (+918133066128) Cytotec 200mg pills UAE AbudhabiAbortion pills Dubai (+918133066128) Cytotec 200mg pills UAE Abudhabi
Abortion pills Dubai (+918133066128) Cytotec 200mg pills UAE Abudhabi
 
What Does The Engine Malfunction Reduced Power Message Mean For Your BMW X5
What Does The Engine Malfunction Reduced Power Message Mean For Your BMW X5What Does The Engine Malfunction Reduced Power Message Mean For Your BMW X5
What Does The Engine Malfunction Reduced Power Message Mean For Your BMW X5
 
Mercedes Check Engine Light Solutions Precision Service for Peak Performance
Mercedes Check Engine Light Solutions Precision Service for Peak PerformanceMercedes Check Engine Light Solutions Precision Service for Peak Performance
Mercedes Check Engine Light Solutions Precision Service for Peak Performance
 
T.L.E 5S's (Seiri, Seiton, Seiso, Seiketsu, Shitsuke).pptx
T.L.E 5S's (Seiri, Seiton, Seiso, Seiketsu, Shitsuke).pptxT.L.E 5S's (Seiri, Seiton, Seiso, Seiketsu, Shitsuke).pptx
T.L.E 5S's (Seiri, Seiton, Seiso, Seiketsu, Shitsuke).pptx
 
如何办理新西兰林肯大学毕业证(Lincoln毕业证书)成绩单原版一比一
如何办理新西兰林肯大学毕业证(Lincoln毕业证书)成绩单原版一比一如何办理新西兰林肯大学毕业证(Lincoln毕业证书)成绩单原版一比一
如何办理新西兰林肯大学毕业证(Lincoln毕业证书)成绩单原版一比一
 
John Deere Tractors 5415 Diagnostic Repair Service Manual.pdf
John Deere Tractors 5415 Diagnostic Repair Service Manual.pdfJohn Deere Tractors 5415 Diagnostic Repair Service Manual.pdf
John Deere Tractors 5415 Diagnostic Repair Service Manual.pdf
 
一比一原版(UdeM学位证书)蒙特利尔大学毕业证学历认证怎样办
一比一原版(UdeM学位证书)蒙特利尔大学毕业证学历认证怎样办一比一原版(UdeM学位证书)蒙特利尔大学毕业证学历认证怎样办
一比一原版(UdeM学位证书)蒙特利尔大学毕业证学历认证怎样办
 
一比一原版西安大略大学毕业证(UWO毕业证)成绩单原件一模一样
一比一原版西安大略大学毕业证(UWO毕业证)成绩单原件一模一样一比一原版西安大略大学毕业证(UWO毕业证)成绩单原件一模一样
一比一原版西安大略大学毕业证(UWO毕业证)成绩单原件一模一样
 
Top profile Call Girls In Thrissur [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Thrissur [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Thrissur [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Thrissur [ 7014168258 ] Call Me For Genuine Models ...
 
Top profile Call Girls In dewas [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In dewas [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In dewas [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In dewas [ 7014168258 ] Call Me For Genuine Models We ...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN ABUDHABI,DUBAI MA...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN ABUDHABI,DUBAI MA...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN ABUDHABI,DUBAI MA...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN ABUDHABI,DUBAI MA...
 
Electronic Stability Program. (ESP).pptx
Electronic Stability Program. (ESP).pptxElectronic Stability Program. (ESP).pptx
Electronic Stability Program. (ESP).pptx
 
Effortless Driving Experience Premier Mercedes Sprinter Suspension Service
Effortless Driving Experience Premier Mercedes Sprinter Suspension ServiceEffortless Driving Experience Premier Mercedes Sprinter Suspension Service
Effortless Driving Experience Premier Mercedes Sprinter Suspension Service
 
Is Your Mercedes Benz Trunk Refusing To Close Here's What Might Be Wrong
Is Your Mercedes Benz Trunk Refusing To Close Here's What Might Be WrongIs Your Mercedes Benz Trunk Refusing To Close Here's What Might Be Wrong
Is Your Mercedes Benz Trunk Refusing To Close Here's What Might Be Wrong
 
一比一原版(PU学位证书)普渡大学毕业证学历认证加急办理
一比一原版(PU学位证书)普渡大学毕业证学历认证加急办理一比一原版(PU学位证书)普渡大学毕业证学历认证加急办理
一比一原版(PU学位证书)普渡大学毕业证学历认证加急办理
 
Is Your Volvo XC90 Displaying Anti-Skid Service Required Alert Here's Why
Is Your Volvo XC90 Displaying Anti-Skid Service Required Alert Here's WhyIs Your Volvo XC90 Displaying Anti-Skid Service Required Alert Here's Why
Is Your Volvo XC90 Displaying Anti-Skid Service Required Alert Here's Why
 
如何办理(爱大毕业证书)爱丁堡大学毕业证成绩单留信学历认证真实可查
如何办理(爱大毕业证书)爱丁堡大学毕业证成绩单留信学历认证真实可查如何办理(爱大毕业证书)爱丁堡大学毕业证成绩单留信学历认证真实可查
如何办理(爱大毕业证书)爱丁堡大学毕业证成绩单留信学历认证真实可查
 

ssssssssss

  • 1. QTP Open Source Test Automation Framework Implementation Guide Version 1.1 May 2009 DISCLAIMER Verbatim copying and distribution of this entire article are permitted worldwide, without royalty, in any medium, provided this notice is preserved.
  • 2. Table of Contents TABLE OF CONTENTS 1. PURPOSE OF THE DOCUMENT ........................................ 3 2. FRAMEWORK IMPLEMENTATION IN QTP ................................. 4 2.1. Test Settings for Keyword-driven Scripting ....................... 4 2.1.1. Run Settings.............................................. 5 2.1.2. Resources Settings........................................ 6 2.1.3. Environment Tab Settings.................................. 7 2.2. Managing Object Repository ....................................... 8 2.3. Call to Framework ................................................ 9 2.4. Usage of Keywords ............................................... 10 2.5. Test Results for a Keyword-driven Script ........................ 11 3. REFERENCES .................................................. 12 Open2Test.org Page ii
  • 3. QTP Open Source Test Automation Framework Implementation Guide 1. Purpose of the Document This document provides an overview of the prerequisites and settings required to implement the Keyword-driven Framework in HP QuickTest Professional (QTP). Open2Test.org Page 3
  • 4. QTP Open Source Test Automation Framework Implementation Guide 2. Framework Implementation in QTP The Keyword-driven Framework is an application independent framework that performs all possible actions and verifications on an object. Hence, the code for the same object can be used across different applications. 2.1. Test Settings for Keyword-driven Scripting In the keyword-driven approach the entire script is developed with keywords. The script is developed in a spreadsheet that is interpreted by the main driver script, which then uses the function library to execute the complete script. The QTP Settings.vbs file can be used to easily perform the test settings that are needed before proceeding with the Keyword-driven Scripting. This file associates the Function libraries, recovery scenarios, Environment Variables and the Object Repository files that are needed for a script. The QTP Settings file needs to be customized before usage. Edit the .vbs file in notepad and make the necessary changes (mentioned below) in the ‘Input Data’ section of the file. 1. Function Libraries – Specify the path where the Framework Files, Common Functions and the User Defined Functions are stored. 2. Recovery Scenario File - Specify the path of the file where the Recovery scenarios are placed. 3. Recovery Scenarios Name - Specify the names of the Recovery scenarios that need to be associated to the test script. 4. Environment File - Specify the path of the xml file for the Global Environment Variables. 5. Object Repository files - Specify the path of the Object Repository. Open the test script in QTP for which the settings are needed and double click on the QTP Settings.vbs file. This file will perform the preferred settings automatically. If there are multiple items of libraries, object repositories or global variables file, they can be specified as an array separated by ‘,’ Set the Flag envi_flag, recover_flag, repos_flag, library_flag to "Yes" if the corresponding files need to be associated to test, Else set it to "no" Open2Test.org Page 4
  • 5. QTP Open Source Test Automation Framework Implementation Guide Given below is a sample “QTP Settings”. libraries= array ("C:WebFramework.vbs","C:common functions.vbs") recovery_file= "C:recover.qrs" recovery_name=array("Scenario1","Scenario2") environment_file= "C:Environment.xml" repository_name= array ("C:repository1.tsr","C:repository2.tsr") 'NOTE: Please set the Flag to "Yes" if the files are to be associated to test, otherwise set it to "no" envi_flag="yes" recover_flag=" yes" repos_flag=" yes" library_flag=" yes" There should be just one Recovery file which holds all the Recovery scenarios. Multiple Recovery files cannot be used. There should be no unsaved tests currently open in QTP. The test script for which the test settings need to be done should be open in QTP. 2.1.1. Run Settings In the Run tab of the Test Settings dialog, 1. The Run one iteration only radio button will be selected. 2. The Disable Smart Identification during the run session check box will be checked. 3. The Object Synchronization timeout value will be set as 20 seconds. Open2Test.org Page 5
  • 6. QTP Open Source Test Automation Framework Implementation Guide Figure 1: Run Settings 2.1.2. Resources Settings After the run settings are completed, the QTP Settings file associates the framework with the test script. Here, the path and the names of the framework files need to be specified in the QTP Settings file. The framework will be taken from the location specified and associated with the test as shown below. Figure 2: Associating Framework File NOTE: The Common functions file and the User defined functions file should be associated with the test only if needed by the test script. Open2Test.org Page 6
  • 7. QTP Open Source Test Automation Framework Implementation Guide 2.1.3. Environment Tab Settings QTP can insert a value from the environment variable list, which is a list of variables and corresponding values that can be accessed from the test. Throughout the test run, the value of an environment variable remains the same, regardless of the number of iterations, unless the value of the variable is changed programmatically in the script. Associating the user-defined Environment Variables file with the test is also handled by the QTP Settings file. The Environment Variables file with an .xml file type will be taken from the path specified in the QTP Settings file and associated with the test. Figure 3: Loading Environment Variables from xml File Open2Test.org Page 7
  • 8. QTP Open Source Test Automation Framework Implementation Guide 2.2. Managing Object Repository After the test settings are completed, the QTP Settings file continues to associate the specified shared object repositories with the test. The objects from the shared repository will be uploaded and made available for the tests. Figure 4: Associate Repositories Dialog Open2Test.org Page 8
  • 9. QTP Open Source Test Automation Framework Implementation Guide 2.3. Call to Framework The call to Keyword_Driver() needs to be specified in the Expert View as shown below. This will call the Framework file associated with the test and perform the actions by interpreting the keywords specified in the data table. Figure 5: Call to Framework Open2Test.org Page 9
  • 10. QTP Open Source Test Automation Framework Implementation Guide 2.4. Usage of Keywords The keywords should be entered in the global sheet of the data table of the test according to the syntax. To access the data table, choose View > Data Table or click on the toolbar button. Below is an example of Keyword-driven Scripting. Figure 6: Using the keyword in a Data Table Open2Test.org Page 10
  • 11. QTP Open Source Test Automation Framework Implementation Guide 2.5. Test Results for a Keyword-driven Script Test execution results can be viewed and analyzed as soon as the run session ends. To access the test results, choose Automation > Results or click on the toolbar button. The results window will be displayed. Figure 7: Results in QTP Open2Test.org Page 11
  • 12. QTP Open Source Test Automation Framework Implementation Guide 3. References HP QuickTest Professional Help documentation COPYRIGHT This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. Open2Test.org Page 12