test automation framework user manual

Upload: nipuna-vijay

Post on 30-Oct-2015

117 views

Category:

Documents


2 download

DESCRIPTION

Test Automation Framework User Manual

TRANSCRIPT

MS Word Portrait Template

Test Automation Framework - User Manual

Test Automation Framework - User Manual

Global Testing Practice

Test Automation Framework User ManualGTP-India47/1, 9th Cross, J P NagarBangalore, Karnataka, 560 076, IndiaProject Name:

Amendment History - Document Status (e.g. Draft, Final, Release #):

CR# (optional)Document Version#Approval DateModified BySection, Page(s) and Text Revised

0.1NANadeemInitial Draft

0.210-May-08Nadeema) Added the Amendment History table

b) Updated the Installation procedure

c) Updated the features section

0.301-Oct-08Nadeema) Updated Test_Templates section by describing all the Templates

b) Modified Test_Settings.xml file

c) Updated Utility Function Library section

d) Added the procedures for developing and executing Keyword driven scripts and functions.

0.405-Nov-08Nadeema) Updated the installer section where the dll file is automatically moved to the assembly folder.

Glossary of Acronyms

AcronymFull Length

GUIGraphical user Interface

QTPQuickTest Professional

QCQuality Center

Table of Contents

Use F9 to update the TOC

51Objective

62High level design features

63Supported Environment

64Supported Modes of Automated Script execution

75Architecture

76Procedure for Installing the Framework

87Folder Structure and Components

138Procedure for Developing Shared Test Object Repository

149Procedure for Developing Test Data Tables

1410Library of Utility Functions

1711Procedure for Developing Automated Test Scripts

1812Procedure for Configuring Test Environment

1913Procedure for Executing Automated Test Scripts

2114Known Limitations

2115Acknowledgement

1 ObjectiveFunctional Test Automation, much as it is essential for achieving higher Test coverage and improved Test execution productivity on any project has its own challenges that are derived from but not limited to the following

The type of application (Web based or non Web-based)

The technology used to develop the application (Java, .NET etc)

The platform used to host the application (Windows, Unix etc)

The complexity of the business functionality and its User interface design

In a scenario where the inputs/requirements for any Test Automation project are varied, the need of the hour is to develop a Test Automation Framework that can accommodate these varying inputs/requirements and additionally provide the following benefits

A consistent architecture for the automated solution

A consistent approach to develop the automated solution specific to each Test Automation project.

Improved Test script development productivity

Reusable Utility functions that can be consistently used across all technologies supported by the Tool

In EDS, the preferred Test Automation tools are the HP-Mercury tools namely QuickTest Professional (QTP) and Quality Center (QC).

QTP is the primary tool of choice for implementing Test Automation on all projects in future, unless the client has a specific preference to use tools from other vendors.

With this in focus, the Test Automation sub-capability has worked on developing a Generic Test Automation framework using QuickTest Professional tool.

The objective of this document is to provide the details of the different components of the Generic Test Automation Framework that is a core part of the Organizational strategy in establishing consistency in the way the Functional Test Automation projects would be executed across GTP.

To enable end users to understand and use the framework, this document details the way the Framework supports the development, maintenance and execution of the automated test scripts. In addition to this, the document also provides the necessary details related to configuration of the framework as well as the way to create and use external data sources for enabling creation of automated test scripts using the Data driven or Keyword driven approaches.2 High level design features

The framework developed using QTP has the following features For all QTP supported technologies, the Framework

Provides a consistent approach for developing automated test scripts for applications that are either Web based or non Web based

Provides a Library of technology independent reusable Utility functions.(Same functions can be used to automate applications developed using Java or .Net or VB etc irrespective of whether it Is Web based or non Web based)

Supports creation of automated scripts using either the data driven or keyword driven approaches. Enables increased test script development productivity on a project as it provides reusable architecture and code.

Provides end users with the means to execute scripts via Quality Center or via an Excel based interface.

Provides end users with the means to configure and execute randomly selected Test scripts for any module of the application being tested.

Provides the end users the feature of randomly selecting the required Test data rows from external Test data sources.

Provides a folder structure to logically group the required Test Automation artifacts on local systems where the automated scripts are to be executed.

3 Supported Environment

Test Management Tool : Quality Center

Test Automation Tool : QTP version 9.2 or higher

Supported Operating Systems: All QTP supported operating systems

Supported Browsers: All QTP supported browsers

4 Supported Modes of Automated Script execution

In the Quality Center Environment, the framework supports execution of automated test scripts from the Test Lab module via creation of Test sets. In a non Quality center environment, the framework supports execution of automated test scripts on the local systems via Test driver.5 Architecture

Data driven framework

Keyword driven framework

6 Procedure for Installing the Framework

The Test Automation Framework related artifacts and supporting folder structure can be installed on the Local System by using its Installer.

Refer the documented inserted below for the procedure related to the installation of the Test Automation related artifacts.

Please note that the framework supports developing and executing the test scripts either via Quality Center or on a local system when Quality Center is not used.

In a scenario where Quality center is used, we need to complete the installation of the framework artifacts on a local system (as explained above in the inserted document) and then complete the following tasks.

Create the project-specific folder on Quality Center in the Test Plan module. Under the project-specific folder on Quality Center:

Replicate the folder structure as available on the local system after installation

Transfer the framework files from the local system to the corresponding folders on the Quality Center project.

Updating the Test_Settings.xml file

In the Test_Settings.xml file available in Test_Configuration folder in Quality Center, update the value tag of the tag PROJECT_FOLDER_PATH with the absolute path of the folder under which the framework artifacts are installed on the local system.For Ex: If the framework is installed in the D: drive in the folder named Generic_Framework, then the value of the PROJECT_FOLDER_PATH should be as follows.

******************************************************************************************************************

PROJECT_FOLDER_PATH

D:\Generic Framework

Note: In a non Quality Center environment also, the PROJECT_FOLDER_PATH variable in the Test_Settings.xml file available in the Test_Configuration folder on the local system needs to be updated in the same way as explained for the Quality center environment.

If the testing of Web applications is carried out on multiple browsers, update the BROWSER_TYPE tag with the values corresponding to different browsers as shown below.

a) When testing has to be done on Internet Explorer browser, the value should be InternetExplorerb) When testing has to be done on Mozilla Firefox browser, the value should be MozillaFirefox

c) When testing has to be done on Netscape browser, the value should be Netscape

7 Folder Structure and ComponentsTo logically group all the Test Automation Framework artifacts, the following folder structure is used on a local system where the execution of the automated scripts is carried out.

This group of folders will be created when the installation of the framework is completed using the setup file.

***********************************************************************************************************

[Project_Name] Test_Configuration

Test_Data

Test_Drivers

Test_Libraries

Test_Object_Repositories

Test_Result_Log

Test_Scripts

Test_Templates

Test_Documentation***********************************************************************************************************

Details of each folder

[Project_Name]:

This is the main folder under which all the artifacts used for the Test Automation project are stored. To uniquely distinguish the artifacts across different projects, it is suggested that the main folder is given the name that has a reference to the project name/ID.

Test_ConfigurationIn this sub folder, the file named Test_Settings.xml, that stores the Test environment variables and their corresponding values is stored by default. New variables can be added as required in this file.In a non Quality center environment, the Test_Execution_Configuration.xls file (created using its template) that provides inputs to the Test driver script on the modules and the corresponding automated scripts that need to be executed is also stored in this folder. When the keyword driven approach is used, the KeywordDriven_FunctionReferences.xls file that contains a mapping of the Keyword driven functions and the library files in which they are stored will also be updated and stored in this folder.

Test_DataIn this sub folder, the external Test data source files are stored. The test data files should be created by using the template Test_Data_Source_Template.xls that is stored in the Test_Templates folder. Multiple data files and each file containing multiple test data tables can be created and stored in logically related sub-folders in this folder.

Refer the section Procedure for creating Test Data Tables for more details.

Note: A sample data file is also shown in this folderTest_Drivers

In this sub folder, the Test driver script named DriverScript.vbs that is used to execute automated scripts developed using data driven approach or keyword driven approaches is stored.Note: The test driver is used for executing selected automated scripts only when Quality Center is not used on the project. If Quality center is available, Test sets containing the required test scripts will be created in the Test Lab module in Quality center and used for executing the required test scripts.

Test_LibrariesIn this sub folder, the following files are available.

a) Framework_Utility_Functions.vbs. This file contains reusable Utility functions that act as building blocks for developing the automated test scripts.

The user has the option of adding more Utility functions to the existing Library. The user is also recommended to create a Library of Business functions and store the file in this folder.

Refer the section Library of utility Functions for more details on the existing functions in the library file.Note: Sample business function libraries created for use in data driven and keyword driven scripts have also been included in this folder.

Test_Object_RepositoriesIn this sub folder, one or more Shared Object repositories, that contain the Test Object Properties of all Test objects that are referenced in automated scripts, are stored. Note that the shared repositories are created using the standard process as defined in QTP. Refer the section Procedure for Developing Shared Test Object repository for more details.Test_Result_Log

In the scenario where Quality Center is not used for execution of automated test scripts, the QTP generated result file that contains the details of all execution steps for the selected automated scripts will be stored in this folder with the name corresponding to the date-timestamp when the execution was initiated. Refer the section Procedure for Executing Automated Test Scripts for more details.

Test_Scripts

In the Data driven approach, Test Scripts are created using the QTP based Test script template named DataDrivenScript_Template that is available in the Test_Templates folder.In the Keyword driven approach, test scripts are created using the excel based template named

KeywordDriven_ActionFile_Template.xls.It is mandatory to store the logically related test scripts belonging to a module in the application under corresponding sub-folders and store the corresponding automated test scripts in these sub-folder.

For Ex: If the application has modules named Admin, Reports etc and for each of these modules there are multiple test cases that are to be automated, then in the Test_Scripts folder create sub-folders named Admin and Module (or any name as per conventions defined in the project) and store the correspondingly related automated scripts in the Admin and Reports sub-folders.

Note: Sample scripts created using Data driven and Keyword driven templates are also shown in this folder.Test_TemplatesIn this sub-folder, the following templates are provided.

a) Test_Data_Source_Template.xls: This template is used for creating the required test data tables for either the keyword driven or data driven test scripts. Please refer the Instructions worksheet for more details.

Also note that we can create multiple test data files and each file can have multiple test data tables. It is recommended to store the project specific data files in logically named sub-folders in the Test_Data folder (similar to the recommended way for storing automated scripts in the Test_Scripts folder).

b) Test_Execution_Configuration_Template.xls: This template is to be used only when there is a requirement of executing the automated test scripts on a local system without using Quality center. The entries in this file are used as inputs for the Test driver to enable the execution of selected scripts of the corresponding modules of the application being tested.

The template should be renamed to Test_Execution_Configuration.xls and placed in the Test_Configuration folder.

Refer to the Instructions worksheet in the template for more details on conventions to follow in making specific entries in the Module_Selection worksheet as well as creating additional worksheets that contain a listing of the automated test scripts available in each module.

c) DataDrivenScript_Template: This QTP based test script template is applicable only for creating data driven scripts and is not required in the Keyword driven approach.

Note: The inserted document is shown in text format to eliminate the need to use QTP for viewing the file content.

d) KeywordDriven_BusinessFunctions_Template: This is used for developing the Keyword driven business functions. The file should be renamed and placed in the Test_Libraries folder when used for creating the Keyword driven business functions. All functions created in this file should have the fn_ prefix.

Note: This template is used only in the Keyword driven approach. Please refer the Instructions worksheet for more details.

e) KeywordDriven_FunctionReferences_Template: This template is used for mapping the Keyword driven functions and the library files in which they are stored. This file should be renamed to KeywordDriven_FunctionReferences.xls and stored in the Test_Configuration folder.Note: This template is used only in the Keyword driven approach. Please refer the Instructions worksheet for more details.

f) KeywordDriven_ActionFile_Template: This template is used for developing the Keyword driven scripts. The file should be renamed and placed in sub-folders that group logically related action files in the Test_Scripts folder.If there are a large number of test scripts in a module (For Ex: 500), then it is recommended to store the test scripts in multiple action files (probably 5 action files and each containing 100 automated scripts) to enable easy maintenance.Note: This template is used only in the Keyword driven approach as defined in the framework.

g) KeywordDriven_ActionFile_DriverScript_Template: This QTP based Test script template is used for creating the driver script that is used for executing the Keyword driven scripts that are stored in the Action files to which the driver is associated. The name and the location of the driver script should be the same as that of the action file to which it is associated. Please refer the Instructions worksheet for more details.It is mandatory that you create one driver script for each action file that exists. Note: This template is used only in the Keyword driven approach. The inserted document is shown in text format to eliminate the need to use QTP for viewing the file content.

Test_DocumentationIn this folder any documentation relevant to the Test Automation framework can be placed. The documents placed in this folder will not impact the execution of the automated scripts in any way.

8 Procedure for Developing Shared Test Object Repository

The Test Automation Framework supports creation of the test repository in the format supported by QuickTest Professional (QTP).

The framework also supports the use of one or more shared object repositories:

Using a shared repository reduces redundancy and is strongly recommended.

Object repositories in external Excel files in a customized or user-defined format are not supported.

Refer the inserted document for the details on the following

How to add Test Objects to a repository

Exporting the Test Objects to a Shared repository

Conventions followed in naming Test Objects used in the Shared Object Repository

a) It is mandatory that the logical name of each Test object across all the Shared Object repositories be unique.

Note that if OK button is present in two separate screens, it should be named differently when it is captured and stored in the Object Repository.

b) Create and store the project-specific shared test object repositories in the Test_Object_Repositories folder.

c) The required Object repository files for the test should be manually associated to the corresponding QTP test script file in the data driven approach and in case of the Keyword driven approach the required repository files should be associated to the corresponding action file driver script.Note: The standard procedure as defined in QTP for creating repositories and adding objects to a shared repository is followed in the framework. Refer to the QTP help file for details on updating or merging the test object repositories using the object repository manager.

9 Procedure for Developing Test Data Tables

To create Test data sources in excel format and also the Test data tables in these sources, follow the procedure as outlined in the inserted document.

10 Library of Utility Functions

The Utility functions in the Framework_Utility_Functions.vbs file that is present in the Test_Libraries folder are the building blocks for developing the application specific business functions as well as the automated test scripts using either the Keyword driven or data driven approaches.

It is mandatory that the details of the functions be understood before using them in developing the automated test scripts.

The feature of these Utility functions is that they can be used for developing automated test scripts for testing functionality of Web based or non web based applications. Additionally, these functions can be used for developing automated scripts irrespective of whether the application is developed using Java or .NET or VB or AJAX or any other QTP supported platforms.

Hence a great deal of reusability (across technologies or application types) is imbibed in these Utility functions.

The utility functions in Framework_Utility_Functions.vbs can be categorized into:

Common functions for automation of both Web-based and non-Web-based applications

Functions for automating Web-based applications only

Functions for use in the keyword-driven approach only

Framework support functions

Common functions for automation of both Web-based and non-Web-based applications

The table below lists some Utility functions that can be used for performing tasks/validations in GUI based applications. These functions can be used for developing automated scripts for testing applications that are either Web based or non Web based applications.

Function NameInformation on usage

Launch_ApplicationUsed to launch the browser or Windows-based application.

Enter_Value_In_Edit_FieldUsed to enter string values in default or encrypted form in Edit or Text fields of a GUI.

Can also be used for entering data in the fields of terminal emulators with a character-based interface.

Click_ObjectUsed on components that support the Click operation (push buttons, links, and images).

Select_CheckBox

Used to select or deselect a check box.

Select_RadioButtonUsed to select or deselect a radio button.

Select_Item_From_ListBoxUsed to select a specified value from a list of values in a drop-down list box.

Select_Item_From_ComboBoxUsed to select a value from a list of values in a drop-down combo box; selects a value that matches a partial string value that is specified as an argument.

Validate_Object_PropertyUsed to compare the actual value of a property of the specified test object with its expected value.

Close_ApplicationUsed to close the browser or application that is being tested.

Functions used in Web-based applications onlySome components like Web tables are specific only to the user interface of web based applications only. The framework provides the functions listed in the table below to work on tables that are present in the user interface of web based applications.Function NameInformation on usage

Click_Link_In_WebTableUsed to perform the click operation on a link in a Web table.

Verify_Value_In_TableSearches for a specified value in a Web table, and returns true if the item is found, else returns false.

Get_Table_Row_NumberReturns the row number of the specified item in the Web table.

Get_Table_Row_Number_Of_Row_NameReturns the row number when the name of the specified row in a Web table is passed as an argument.

Get_Table_Column_NumberReturns the column number of the specified column name in the Web table.

Functions used in Keyword driven approach onlyThe framework supports developing automated scripts using the data driven or keyword driven approaches. The list of functions in the table below are specific only to the Keyword driven approach for developing automated scripts using the framework.Function NameInformation on usage

Start_TestUsed collectively to control the start and end section of each of the keyword-driven test scripts in the action files. It is mandatory for each keyword-driven test script to begin with Start_Test and to end with End_Test.

End_Test

Start_FunctionUsed collectively to control the start and end section of each of the keyword-driven functions. It is mandatory for each keyword-driven function to begin with Start_Function and to end with End_Function.

End_Function

Framework support functionsThe following list of functions are used for developing the core logic in the framework and are not meant to be included (by function calls) directly in the automated test scripts that are developed.Function NameInformation on usage

Set_Application_Type_PropertyDetermines if the application being tested is Web-based or non-Web-based so that it can invoke the right method on specified objects.

Search_Associated_RepositoriesSearches for the logical name of the test object in multiple object repositories.

Please refer the inserted document for a listing of all Utility functions that exist in the Framework_Utility_Functions.vbs file.

11 Procedure for Developing Automated Test Scripts

Pre-requisites: QTP version 9.2 or any higher version of the tool should be used.

Any specific add-in required for the test should also be loaded on the system where QTP is installed

In a non Quality center environment, Installation of the framework related artifacts should be complete on the local system. But in a Quality center environment, the same folder structure along with corresponding artifacts available on the local system after installation is complete, should be replicated and available in the required project folder in Quality center.

The EDS_Automation.dll file should be moved manually to the c:\Windows\Assembly folder or c:\WinNT\Assembly folder. The required shared Object repositories should have been created and stored in the Test_Object_Repositories folder and the logical names of all the Test objects stored in the shared repositories should be Unique

The required Test data sources containing test data tables should have been created and stored in the Test_Data folder by following the instructions specified in the Test_Data_Source_Template.xls file.

The automated scripts should not be stored directly under the Test_Scripts folder but should be stored under sub-folders that group logically related scripts.

Developing Data driven test scriptsPlease refer the inserted document for information on how to create business functions and automated test scripts using the Data driven approach as supported by the framework.

Developing Keyword driven test scriptsPlease refer the inserted document for information on how to create business functions and automated test scripts using the Keyword driven approach as supported by the framework.

12 Procedure for Configuring Test Environment

In the framework, the following files are provided to enable configuring the Test environment.

a) Test_Settings.xml file: This is the default file that is provided in the environment. It is mandatory that the required variables available in the Test_Settings.xml file be updated with the values specific to the environment defined for the project irrespective of whether the Data driven or keyword driven approach is used for developing the automated scripts.

be updated

In the framework, the variables in the Test_Settings.xml file need to be updated as explained in the Updating the Test_Settings.xml file section.b) Test_Execution_Configuration_Template.xls: This template, available in the Test_Templates folder, is used only in the scenario where Quality center is not used and execution needs to be done on the Local systems. This is provided in the framework to enable the users to randomly select and execute automated scripts of any modules on the local system where QTP is installed by using the Test_Execution_Configuration_Template.xls file.Refer to the Instructions worksheet in the template for more details on conventions to follow in making specific entries in the Module_Selection worksheet as well as creating additional worksheets that contain a listing of the automated test scripts available in each module.

The entries made in the Test_Execution_Configuration.xls file will be the inputs for the Test Driver script that will execute all the selected scripts of all the selected modules. The Test execution stops when all the selected scripts of all selected modules have been executed.Note: At least one module in the Module_Selection worksheet of the Test_Execution_Configuration.xls file needs to have the value Yes in the Execute column. In the worksheet containing the automated test scripts for the selected module at least one script should be selected for execution by providing the value Yes in the Execute column.b) KeywordDriven_FunctionReferences_Template.xls: This template, available in the Test_Templates folder, is used only in the scenario where the Keyword driven approach (as per the procedure in the framework) is followed for developing the required business functions for use in the Keyword driven scripts.When Keyword driven approach is used on the project and when one or more Keyword driven business function libraries have been created using the template KeywordDriven_BusinessFunctions_Template.xls, and stored in the Test_Libraries folder, the KeywordDriven_FunctionReferences_Template.xls should be copied to the Test_Configuration folder and renamed to KeywordDriven_FunctionReferences.xls.

After renaming of the template is complete, follow the conventions in the Instructions worksheet of this template for mapping the Business function names and the Library files in which they are located.

This is done so that the Action File driver script can locate the library function file and execute the steps of the specific function that is referenced in the Keyword driven script available in the Action file to which the driver script is mapped.

It is mandatory that all the Keyword driven functions that have been created for use in the keyword driven scripts be referenced in the KeywordDriven_FunctionReferences.xls file. Else there will be runtime error as the Action file driver script will not be able to locate and execute the steps of the corresponding keyword driven business function.13 Procedure for Executing Automated Test Scripts

Pre-requisites

The required variables in the Test_Settings file should have been updated to reflect the actual Test environment. In case Quality center is used, the required Test sets comprising the automated test scripts for execution should exist in the Test Lab module in Quality center. In case Keyword driven scripts exist, the driver scripts of the action files should be added to the test set.

In case Quality center is no used, the Execute columns in the Module_Selection and the additional worksheets worksheet present in Test_Execution_Configuration.xls file should have been updated to indicate the scripts of which module should be selected for execution when the test is initiated by using the DriverScript.vbs file available in the Test_Drivers folder.

ProcedureIn a Non Quality center environment

For initiating execution of scripts created using either the data-driven or keyword-driven approach on the local system, the script file named DriverScript.vbs is used.

User can initiate the execution by double clicking on the DriverScript.vbs file.

Using the information on the Module_Selection worksheet of the Test_Execution_Configuration.xls, the driver identifies all the modules whose scripts need to be executed by referencing the value Yes in the Execute column.

For each of the selected modules, the driver identifies the worksheet with the same name as the module name and executes all the scripts that have been marked for selection by referencing the value Yes in the Execute column.

The execution stops when all selected scripts of all selected modules have been executed.

Creation of Result Logs

When execution is initiated on the local system using the test driver script:

In the Test_Result_Log folder, a sub-folder named with the date-time stamp of when the execution was initiated is created.

Under the date-time stamp folder, a sub-folder with the name of the module listed in the Module_Name column of the Module_Selection worksheet is created.

For each of the automated scripts of the module that are selected for execution, corresponding sub-folders are created where the QTP-generated result files are stored.

For each cycle of execution, folders with names corresponding to the various date-time stamps are created for the result logs.

. In a Quality center environment

For initiating execution of scripts created using either the data-driven or keyword-driven approach on the local system, follow the standard procedure for executing test scripts from the Test sets created in the Test Lab module of Quality Center. After execution is complete, the default result file for each Test script will be created and this can be accessed from Quality center.Note: The Test_Result_Logs folder will not contain any results when the execution is initiated from Quality Center.14 Known Limitations

The framework is developed by using QuickTest professional tool and does not support development of automated test scripts using any other Test automation tool like SilkTest or TestPartner or Selenium etc. The framework supports functional Test automation using QuickTest professional tool version 9.2 or higher only.

The framework has not been tested on SAP or Oracle based applications due to lack of availability of these applications. But the assumption is that by using the appropriate add-ins, the existing Utility functions provided in the framework can be used for developing the automated test scripts on all QTP supported platforms.

15 Acknowledgement

The following resources have contributed to the design and development of the framework.

Meena Puttaraju

Girish S Mohamed Yehia

Vijay Raghavendra

Ashok Reddy

EMBED Word.Document.8 \s

Date-time stamp

Module name

Script names

Template Control: MS Word Portrait TemplateTemplate Version 1.1 -- Approval Date 26 Sep, 2008

Saved 5 November, 2008EDS InternalPage 1 of 21

EDS and the EDS logo are registered trademarks of Electronic Data Systems Corporation.

EDS is an equal opportunity employer and values the diversity of its people.

Copyright 2008, Electronic Data Systems Corporation. All rights reserved.Saved 5 November, 2008EDS InternalPage 2 of 21

Copyright 2008, Electronic Data Systems Corporation. All rights reserved.

_1284574254.xlsInstructions

Instructions on how to enter data in the different columns of this template

FUNCTION_NAME: Please enter the name of the business function. The name of the function should start with the "fn_" prefix. for Ex: fn_CreateOrder, fn_Login

DESCRIPTION: Please enter a brief description about the function.

KEYWORD: Please select the required keyword from the list. Note that all the scripts should begin by using the "Start_Test" keyword and end by using the "End_Test" keyword. Corresponding to the Keyword/Function used, any required parameters need to be referenced in the "TESTOBJECT_NAME" and "ADDITIONAL_PARAMETERS" column.

TESTOBJECT_NAME: Please enter the logical name of the required Object as present in the shared test object repository( only if the keyword to be used requires the test object reference as an argument ).For some keywords like "Start_Function", "End_Function", or business functions, there may not be a requirement of providing any logical names in this column.( Please refer the definition of the corresponding keyword in the Utility function library before usage)

ADDITIONAL_PARAMETERS: Other than the parameter corresponding to the logical name of the test object, all parameters that are passed to the function/keyword,as per its definition in the Utility function library, are considered as additional parameters. The corresponding values for these parameters should be entered in the same sequence as required by the corresponding keyword/function.

a) If multiple parameters are required, separate them using "|" character.b) If the parameter values are hard coded please enclose them in double quotes For ex: "Hello"c) If the parameter values are fetched from external data tables, please provide the name of the column in the table from which the data is fetched and do not enclose the names of columns in double quotes: For ex: LOGIN_IDd) If the parameter values are fetched from environmental variables, please provide the "ENV_" prefix to these variables and do not enclose the names of columns in double quotes: For ex: ENV_ResultPath

Additional Info

"Keyword_List" sheet name should not be renamed

"BusinessFunction_Template" worksheet can be renamed as per project specific requirement.

The "Keyword_List" worksheet contains the list of all available keywords for use in developing the automated test scripts.Any new keywords that are created should be listed in "Keywords" column of this worksheet. The keywords entered in this column are automatically listed in the list of values available in the "KEYWORD" column of the "BusinessFunction_Template" worksheet.

Rename this file and store it in the "Test_Libraries" folder or in any sub-folder in the "Test_Libraries" folder.

Please ensure that macros setup are set to enabled(by navigating to Tools->Macros->Security & set the security level as "Low") as the file contains macros

BusinessFunction_Template

FUNCTION_NAMEDESCRIPTIONKEYWORDTESTOBJECT_NAMEADDITIONAL_PARAMETERS

Keyword_List

Keywords

Click_Button_On_Toolbar

Click_Link_In_WebTable

Click_Object

Close_Application

End_Function

End_Test

Enter_Value_In_Edit_Field

Launch_Application

Select_CheckBox

Select_Item_From_ComboBox

Select_Item_From_ListBox

Select_Item_From_RadioGroup

Select_Menuitem_From_Toolbar

Select_RadioButton

Start_Function

Start_Test

Validate_Object_Property

_1284826874.xlsFunctions_List

Function NameDescriptionApplicable Test ObjectsArgumentsReturn ValueExampleApplicable To

FUNCTIONS COMMON TO "BOTH WEB BASED & NON-WEB BASED APPLICATIONS"

Enter_Value_In_Edit_Field1. Enters the specified value into the specified object.2. Value can be entered as it is or it can be encrypted using the password Encoder tool installed with QTPEditboxstrObjectLogicalName Ex: "DV"Val Ex : "45"IsEncrypted : Mention if the previous value is a password or not Ex. "YES" or "NO"Returns "PASS" if successfully enter the value in the Edit field, else returns "FAIL" & Logs the error in QTP resultCall Enter_Value_In_Edit_Field ("AgentName", "mercury","No")Call Enter_Value_In_Edit_Field("Password","47d54e3e34c125e1ac768eeb05056b16088d","Yes") where the second argument is encrypted using QTP password Encoder tool1. Both WebBased & Non-WebBased Applications2. Both Datadriven & Keyword Driven approaches

Click_ObjectPerforms a click operation on thespecified objectButton , Image , Link ,..strObjectLogicalName Ex: "OK"Returns "PASS" if successfully clicks on the object, else returns "FAIL" & Logs the error in QTP resultCall Click_Object ("OK")1. Both WebBased & Non-WebBased Applications2. Both Datadriven & Keyword Driven approaches

Select_CheckBoxSelects or deselects the checkbox for thespecified object.CheckboxstrObjectLogicalNameEx: "DV" Val = "ON" Or Val = "OFF"Returns "PASS" if successfully perfoms the action on the checkbox, else returns "FAIL" & Logs the error in QTP resultCall Select_CheckBox ("Pass", "ON")1. Both WebBased & Non-WebBased Applications2. Both Datadriven & Keyword Driven approaches

Select_RadioButtonSelects or deselects the Radio button forthe specified object.RadiobuttonstrObjectLogicalName Ex: "DV"Returns "PASS" if successfully perfoms the action on the Radiobutton, else returns "FAIL" & Logs the error in QTP resultCall Select_RadioButton ("DV")1. Only for Non-WebBased Applications2. Both Datadriven & Keyword Driven approaches

Select_Item_From_ListBoxSelects a value from the ListBox that matches the value passed as an argument.

Note: The complete value needs to be passed as an argument to this function.ListboxstrObjectLogicalName Ex: "Country"ItemName Ex : "India"Returns "PASS" if successfully perfoms the action on the Listbox/Combobox, else returns "FAIL" & Logs the error in QTP resultCall Select_Item_From_ListBox ("Country", "India")1. Both WebBased & Non-WebBased Applications2. Both Datadriven & Keyword Driven approaches

Select_Item_From_ComboBoxSelects a value from the ComboBox based on a partial value that is passed as an argument.

Note: The partial value needs to be passed as an argument to this function.ComboboxstrObjectLogicalName Ex: "State"ItemName Ex : "KAR"Returns "PASS" if successfully perfoms the action on the Listbox/Combobox, else returns "FAIL" & Logs the error in QTP resultCall Select_Item_From_ComboBox ("State", "KAR")1. Both WebBased & Non-WebBased Applications2. Both Datadriven & Keyword Driven approaches

Validate_Object_PropertyValidates the actual value of a property with the expected value for the specified object.Editbox, Listbox, Checkbox, Button, WebTable, Toolbar, Browser, Page, Image, LinkstrObjectLogicalName Ex: "AgentName"strProperty Ex : "text", "value"strExpected Ex : "mercury"strMessagePass: "Message to be displayed if the verification matches"strMessageFail: "Message to be displayed if the verification doesn't matches""PASS" if the Actual value matches the Expected value, else returns "FAIL"Call Validate_Object_Property ("AgentName", "text", "mercury","Verified for mercury value in the AgentName field", "Mercury value doesnot exists in the AgentName field")1. Both WebBased & Non-WebBased Applications2. Both Datadriven & Keyword Driven approaches

Launch_ApplicationOpens an application using the executable file if present else reports errorApplication URL, Application EXE pathstrPathNoneCall Launch_Application ("C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe")1. Both WebBased & Non-WebBased Applications2. Both Datadriven & Keyword Driven approaches

PressKey_On_Specified_ObjectPress a key on Keyboard - specify object on which the cursor to be placed and the key to be pressedButtonstrObjectLogicalName Ex: "DV"Required Key Ex : micReturn ( to represent Enter Pressing)Example of some keys definition :F1,F2,Enter,BackScript Naming :micF1,micF2,micReturn micBackTo use Ctrl key with any other letter , you should type it as : micCtrlDwn + "X" + micCtrlUp and the same for the shift and ALT keys' Key Pressing Examples : to present ShiftKey + m letter ( M ) add the second arrgument : micShiftDwn + "m" + micShiftUp"PASS" if the Key is pressed else "FAIL"Call Press_Key_on_object("OK", "micReturn")1. Both WebBased & Non-WebBased Applications2. Both Datadriven & Keyword Driven approaches

PressKey_On_Active_ObjectPress KeyBoard button on any active objectActive Object"KeyboardPress" Key to be pressed Ex. F1,F2,Back,EndNonePress_Keyboard_key ("Enter")NOTES :Keyboard Key will be pressed on any active window the problem of this function that if the window is not activated or cursor is not in the right position it will do the action on wrong place1. Both WebBased & Non-WebBased Applications2. Both Datadriven & Keyword Driven approaches

Close_ApplicationClose any opened application by nameWindow, Dialog, BrowserstrObjectLogicalName Ex: "Browser""PASS" if the application in closed else "FAIL"Call Close_Application("Browser" )Note : this function is also covered in the function Click_Button_On_Toolbar with the ActionName "Close"1. Both WebBased & Non-WebBased Applications2. Both Datadriven & Keyword Driven approaches

Select_Menuitem_From_ToolbarSelects an item in a menu or sub-menu or just press on a menu name in the toolbar for windows Application menu is represented without using a tool bar so you can select directly from the menu , while in Web Application you must press on the tool bar first before you select from the menu this function cover both cases, in case there is a toolbar exist or not.Note : Menu should be static menu and not created at run-timeWindow Toolbar, Browser ToolbarstrToolBarNamewithParentNum :toolbar name if exists ( in case of web application ) Ex: "ToolbarWindow32"Note : Leave it blank if you are using windows application or Menu is represented without toolbar.strMenuNamewithParentNum :Menu name to select from , can be left Blank if you want to just click on the tool bar (toolbar that have no menu under it ) Ex. "1_ContextMenu",MenuName Represent the menu name and the sub-menu to be selected in the application ex."&File;Open... Ctrl+O"Note : every sub-menu is separated from the previous level by ";" Examples on the use of function :1 - Call Select_Menuitem_From_Toolbar("ToolbarWindow32","1_Menu","&File;Open... Ctrl+O") :this call selects "&File" from the toolbar "1_ToolbarWindow32" then select "Open... Ctrl+O" from the menu "1_Menu"2 - Call Select_Menuitem_From_Toolbar("","Menu","Colors;Edit Colors...") :Here we don't have a toolbar ( paint application for example) so the function will select "Colors" from the menu then "Edit Colors..." option3 - Call Select_Menuitem_From_Toolbar("Toolbar1","","&File") : this call is to just click on the menu file in the toolbar named "Toolbar1" Note here "&File" is written without having any sub-menu ( NO ";" in the argumnet)"PASS" if clicks on the specified menuitem from the toolbar else "FAIL"Call Select_Menuitem_From_Toolbar("ToolbarWindow32","Menu","Colors;Edit Colors...")1. Both WebBased & Non-WebBased Applications2. Both Datadriven & Keyword Driven approaches

Select_Item_From_RadioGroupSelects or deselects an Item from the Radio GroupRadiogroupstrObjectLogicalName : Logical Name of the RadioGroupItemName : Item Name of the RadioGroup to be selected"PASS" if performs the action on the RadioGroup else "FAIL"Call Select_RadioButton ("DV","ItemName")1. Both WebBased & Non-WebBased Applications2. Both Datadriven & Keyword Driven approaches

LogResult_And_CaptureImageLogs the result into the QTP result & captures the Image of the Application and attaches the Image to the QTP ReportAll ObjectsReportStepName - Name of the step being performedStatus - PASS/FAILReportdetails - Details of the step performedNoneCall LogResult_And_CaptureImage("Validate 'UserID' Field, "PASS","'UserID' Field is displayed in the screen")1. Both WebBased & Non-WebBased Applications2. Both Data Driven & Keyword Driven approaches

Navigate_To_Submenu_By_MouseHoverNavigates to the specified Menu & Submenus using mouse hover method & clicks on the Last Submenu itemMenubarstrObjectLogicalName_Of_MenuAndSubmenuItems: Object Logical Names of Menu & Submenu items on which mouse need to be hovered, all the logical names must be seperated by a delimiter "," (Comma)NoneCall Navigate_To_Submenu_By_MouseHover("File,New,Test") - Navigates to File->New->Test & clicks on the Test to open new test1. Both WebBased & Non-WebBased Applications2. Both Data Driven & Keyword Driven approaches

Hover_MouseCursor_Over_ObjectHovers the mouse on the specified objectAny objectstrObjectLogicalName: Object Name on which mouse need to be hoveredNoneCall MouseOver("File") - Hovers move on the "File" object1. Both WebBased & Non-WebBased Applications2. Both Data Driven & Keyword Driven approaches

Get_Current_Value_Of_ObjectPropertyReturns the current value of the property for the specified objectEditbox, Listbox, Checkbox, Button, WebTable, Toolbar, Browser, Page, Image, LinkstrObjectLogicalName Ex: "AgentName"strProperty Ex: "text", "items count"Current value of the specified property of an ObjectCall Get_Current_Value_Of_ObjectProperty("AgentName", "text")1. Both WebBased & Non-WebBased Applications2. Only Data Driven approach

Execute_QueryExecutes the specified query and returns the recordset .Excel ApplicationstrCompleteFilePathstrQueryRecordsetCall Execute_Query ("C:\QTP_Test\Results.xls","INSERT INTO [Sheet1$] (TestName,Iteration) VALUES ('Login', '1') ")1. Both WebBased & Non-WebBased Applications2. Both Datadriven & Keyword Driven approaches(Not as a Keyword)

Connect_Test_Data_SourceEstablishes the Connection with the Specified Test Data source & assigns the recordset to the global variable - g_objResultSetExcel ApplicationFolderName, FileName in which the Test Data is presentNoneCall Connect_Test_Data_Source("c:\Flight Reservation","Transaction.xls")1. Both WebBased & Non-WebBased Applications2. Only Data Driven approach

Get_DataValueGet the Required field value from the DataSource for the Current IterationRecordsetRow : Row Number in the recordset from which the value need to be fetchedFieldName: FieldName in the recordset from which the value need to be fetchedReturns the Value presentin the recordsetCall Get_DataValue(2, "UserName")1. Both WebBased & Non-WebBased Applications2. Only Data Driven approach

FUNCTIONS SPECIFIC FOR AUTOMATION OF "WEB BASED APPLICATIONS"

Click_Link_In_WebTablePerforms a click operation on the specified link in the WebtableWebTablestrObjectLogicalName Ex: "LoanIQ"strValue Ex: "Loan Type" ( Link to be clicked) intStartingRowNumber Ex: 1strColumnName Ex: "Loan""PASS" if successfully clicks link in the webtable else returns "FAIL"Call Click_Link_In_WebTable ("LoanIQ", "Loan Type","Loan", 1)1. Only WebBased Applications2. Both Datadriven & Keyword Driven approaches

Click_Button_On_ToolbarDo the Actions in the tool bar(close,refresh,home ,back,forward,Stop,activate,restore,minimize,maximize) some Actions are specific for web applications like : refresh,home,back,forwardBrowserstrObjectLogicalName Ex: "Browser"Action Name (close,refresh,home,back,forward,activate,restore,minimize,maximize)"PASS" if the click action is performed on the Toolbar else "FAIL"Call Click_Button_On_Toolbar("Browser","Back")1. Only WebBased Applications2. Both Data Driven & Keyword Driven approaches

Get_Table_Row_NumberReturns the row number of the specified item (strValue) if found in the table. This function should be used when we know the Value we are searching for in the table and the table does not have row names.WebTablestrObjectLogicalName Ex: "LoanIQ"strValue Ex: "Loan Type" intStartingRowNumber Ex: 1strColumnName Ex: "Loan""Row number" if the value exist , returns "FAIL" if the Object doesn't exists & "NULL" if the Value doesn't existsCall Get_Table_Row_Number ("LoanIQ", "Loan Type", 1)1. Only WebBased Applications2. Only Data Driven approach

Get_Table_Column_NumberReturns the column number of the Column name if found in the tableWebTablestrObjectLogicalName Ex: "LoanIQ"'strColumnName Ex: "Loan"'"Column number" if the column value exists else returns "FAIL" if the Object doesn't exists & "NULL" if the column value doesn't existsCall Get_Table_Column_Number ("LoanIQ", "Loan")1. Only WebBased Applications2. Only Data Driven approach

Get_Table_Row_Number_Of_Row_NameFetchs the row number of the specified row name.This function should be used for fetching values in a table using the row names.WebTablestrObjectLogicalName Ex: "LoanIQ"'strRowNameRow Number if the value exists , else returns "FAIL" if the Object doesn't exists & "NULL" if the specified value doesn't existsCall Search_Value_In_Table ("LoanIQ", "Total Amount")1. Only WebBased Applications2. Only Data Driven approach

Get_Value_From_Specified_RowAndColumnNameFetches the value from a table using the specified row name and the column name.WebTablestrObjectLogicalName Ex: """LoanIQ"strRowName, strColumnName, intStartingRowNumberTable element / NullCall Get_Value_In_Table ("LoanIQ", "Total Amount", "Loan", 1 )1. Only WebBased Applications2. Only Data Driven approach

Verify_Value_Exists_In_TableVerifies for a specified value in a table and returns the "PASS" if verification matches else returns "FAIL".WebTablestrObjectLogicalName Ex: "LoanIQ"intStartingRowNumber Ex: 1strColumnName Ex: "Loan"Value existing the specified cell, else returns "FAIL" if the Object doesn't existsCall Verify_Value_Exists_In_Table("LoanIQ", "Loan Type", "Loan",1)1. Only WebBased Applications2. Both Datadriven & Keyword Driven approaches

FUNCTIONS SPECIFIC TO "NON-WEBBASED APPLICATIONS"

Select_TabSelects a Tab from a tab controlWinTab(Windows)strObjectLogicalName Ex: "SysTabControl"TabName Ex. "Security""PASS" if selects a Tab successfully else "FAIL"Call Select_Tab ("SysTabControl32","Security")1. Only Non-WebBased Applications2. Both Data Driven & Keyword Driven approaches

FUNCTIONS SPECIFIC TO "FRAMEWORK DESIGN"

Set_Application_Type_Property1. Checks whether the AUT is a web based or not. If AUT is web based then global variable g_strApplicationType is set to 1 else it is set to -1 Value.2. g_strApplicationType will be used in the Enter_Value_In_Edit_Field function to decide on whether to use SET or TYPE method .-NoneNoneCall Set_Application_Type_Property()Framework Design

Search_Associated_RepositoriesSearches for the Logical Name of the Object in the ObjectRepository. This function will be useful only in case of Mutliple Object repository to an object ( Window("Main").Window("Clarify").WinEdit("DV")) and returns the object.QTP Object RepositorystrObjectLogicalName: Logical Name of the Object to be searchedIndex_of_Repository: Index of the Repository in which the object needs to be searchedIf the Object is Foundin the ObjectRepository then Returns '1' else '0'Call search_Associated_Repositories("AgentName",3)Framework Design

Test_ObjectConverts the string("Window(""Main"").Window(""Clarify"").WinEdit(""DV"")") to an object ( Window("Main").Window("Clarify").WinEdit("DV")) and returns the object.Any objectstrObjectLogicalName: Logical Name of the Object under testobjObject Ex: Window("Main").Window("Clarify").WinEdit("DV")Call Test_Object ("AgentName")Framework Design

Log_ResultLogs the test result into an excel file.strObjectLogicalName Ex: DVstrEvent Ex: Search_Value_In_TablestrActualResultstrExpectedResultstrStatus Ex: Pass / FailNoneCall Log_Result("DV","Search_Value_In_Table","To search value in table.","Object not found.", "Fail")1. Both WebBased & Non-WebBased Applications2. Both Datadriven & Keyword Driven approaches

Download_File_From_QCDownloads the specified file from Quality Center to specified folder(Ex:C:\ or D:\Test\MyFolder\...) on local systemFilesQCFolderPath: Path of the file in Quality Center sLocalfolderPath: Local folder path, where the file should be stored sFileName: Name of the file to be downloaded from Quality CenterPASS: If successfuly downloaded the specifed file from Quality Center elseReason for the failureDownload_File_From_QC("[QualityCenter] Subject\Framework_Keyworddriven\Test_Object_Repositories\Sample_ObjectRepository","C:\","Flight_OR.tsr")1. Both WebBased & Non-WebBased Applications2. Both Data Driven & Keyword Driven approaches

FUNCTIONS SPECIFIC TO "KEYWORD DRIVEN APPROACH"

Execute_Scripts_In_ActionFileInvokes execution of the current Action File-DataFolderPath : Path of the Folder in which the Test Data file exists inside the Test_Data folderDataFileName: Test Datat FilenameActionFile_SheetName: Sheet Name in which the script existNoneCall BaseScript("LOGIN\VALIDLOGIN" ,"Login_Data","ActionFile_Login")1. Both WebBased & Non-WebBased Applications2. Framework Design for Keyword Driven approach - This function cannot be used as a keyword

Execute_Keyword_Script_StatementFunction which evaluates the expression using Keyword,TestObject_Name ,Additional_Parameters-Keyword : Keyword/Function NameTestObject_Name : Logical Name of the ObjectAdditional_Parameters : Remaining parameters for the function seperated by a "|"NoneCall EvaluateExpression("Enter_Value_In_Edit_Field","Date_of _Flight","01-02-08|"No""1. Both WebBased & Non-WebBased Applications2. Framework Design for Keyword Driven approach - This function cannot be used as a keyword

Start_TestFunction is used as Keyword, should be used at the begining of a Test Case in Keyword Driven approach-NoneNoneStart_Test should be used in Actionfile under "KEYWORDS" column1. Both WebBased & Non-WebBased Applications2. Only Keyword Driven approach

End_TestFunction is used as Keyword, should be used at the end of a Test Case in Keyword Driven approach-NoneNoneEnd_Test should be used in Actionfile under "KEYWORDS" column1. Both WebBased & Non-WebBased Applications2. Only Keyword Driven approach

End_FunctionFunction is used as Keyword, should be used at the end of a Function in Keyword Driven approach-NoneNoneEnd_Function should be used in Actionfile under "KEYWORDS" column1. Both WebBased & Non-WebBased Applications2. Only Keyword Driven approach

Skip_TestFunction skips the Test Case which is selected as "No" in Execute column in Action file-NoneNoneSkip_Test()1. Both WebBased & Non-WebBased Applications2. Only Keyword Driven approach -This function cannot be used as a Keyword

Sheet3

_1287405384.xlsInstructions

Points to Note

a) This template (Test_Execution_Configuration) should be used only in a scenario where Quality Center is not used and Test driver script is used for executing the automated test scripts.

b) It is mandatory to rename this template to "Test_Execution_Configuration.xls" and place it in the "Test_Configuration" folder before use on the project.

c) "Module_Selection" worksheet is the default worksheet in this workbook that should not be renamed.

d) If the test scripts corresponding to different modules are stored in subfolders named "Reports", "Defects" etc that are one level below the Test_Scripts folder, then in the "Module_Selection" worksheet, the "Module_name" should contain the corresponding entries "Reports", "Defects" etc. Additionally, the worksheets named "Module1","Module2" should be renamed to Reports", "Defects".

Please note that the names of the worksheets should correspond to the name of the folder where the test scripts are stored.

e) If the test scripts corresponding to different modules are stored in a multiple subfolders and the scripts are stored in the inner most sub-folder, we need to provide the path till the innermost folder in the Module_Name column.For ex: If the required test scripts are placed under "Test_Scripts\MyModule1\Reports\" and "Test_Scripts\MyModule1\Defects\" foldters, then in the "Module_Selection" worksheet, the "Module_name" should contain the corresponding entries "MyModule1\Reports" and "MyModule1\Defects" etc. Additionally, the worksheets named "Module1","Module2" should be renamed to Reports", "Defects".

Please note that the names of the worksheets should correspond to the name of the folder where the test scripts are stored.

f) The worksheets other than "Module_Selection" and "Instructions" contains the columns named "TestScript_Name" and "Execute". The column names should not be renamed.

g) The number of these worksheets other than "Module_Selection" and "Instructions" should correspond to the number of folders under which the automated test scripts are stored.

Module_Selection

Module_NameExecute

Module1YesTable1

Column Headers =>Column1_NameColumn2_NameColumn3_NameColumn4_NameExecute

Test Data Row 1 =>

Test Data Row 2 =>

Template for data table that holds two rows and 6 columns of Test data

Name of Table2 =>Table2

Column Headers =>Column1_NameColumn2_NameColumn3_NameColumn4_NameColumn5_NameColumn6_NameExecute

Test Data Row 1 =>

Test Data Row 2 =>