qtp framework

Click here to load reader

Post on 14-Nov-2014

19 views

Category:

Documents

4 download

Embed Size (px)

TRANSCRIPT

9510853.doc

QTPFrameWork

QTPFrame Work

Confidential

Page 1 of 100

9510853.doc

QTPFrameWork

Table of Contents1. Automation Architecture.......................................................3 1.1 Design........................................................................................................................3 1.2 Approach for Test Automation...................................................................................4 2. Introduction to QTP........................................................12 2.1 QTP Environment Compatibility.............................................................................12 2.2 Versions of QTP.......................................................................................................13 3. Add-Ins...............................................................................21 3.1 Types of Add-Ins......................................................................................................21 3.2 Conditions for Add-ins.............................................................................................22 4. Conventions.........................................................................23 4.1 Test Case Naming Conventions:..............................................................................23 4.2 Script and Action Naming Conventions:................................................................23 4.3 Variables and Constants:..........................................................................................25 4.4 DataSheet Naming and Parameter Naming Conventions:.......................................26 4.5 Function Naming Conventions................................................................................27 5. Settings...............................................................................28 5.1 QTP Test Settings.....................................................................................................28 5.2 Record and Run Settings..........................................................................................29 5.3 Active Screen Capture Level...................................................................................29 5.4 Object Repository....................................................................................................30 5.5 Expert View.............................................................................................................32 5.6 Setting related to the Application Used:..................................................................35 6. Objects...............................................................................38 6.1 Objects....................................................................................................................38 7. Data Table..........................................................................40 7.1 Datatable Object and related Functions:.................................................................40 7.2 Organizing Data Sheets for Global & Local variables............................................41 7.3 Parameterizing using Data driven Wizard.............................................................42 7.4 Importing and Exporting Datasheets:...................................................................46 8. Actions................................................................................49 8.1 Actions Settings.......................................................................................................49 8.2 Iterations using rows................................................................................................50 8.3 Action Template.......................................................................................................51 8.4 Script Startup...........................................................................................................51 8.5 Splitting Actions, Re-usable Actions, Internal/External Actions.............................52 9. Object Repository................................................................54 9.1 Per Action/Shared Object Repository:.....................................................................54 9.2 Merging of two object repositories:.........................................................................56 9.3 Limitations:..............................................................................................................57 10. Variables...........................................................................59 10.1 Action Parameters................................................................................................59Confidential

Page 2 of 100

9510853.doc

QTPFrameWork

10.2 Test Parameters......................................................................................................62 10.3 Environment Variables...........................................................................................63 10.4 Variable passing from one Action to another........................................................64 10.5 Scope of Variables..................................................................................................66 11. Check Points......................................................................68 11.1 Types of Checkpoints.............................................................................................68 11.2 Output Values for Verification...............................................................................70 12. Reusable Library................................................................72 12.1 Introduction...........................................................................................................73 12.2 How to establish a Reusable Library.....................................................................73 12.3 How to use this Reusable Library.........................................................................75 13. Regular Expressions..........................................................75 13.1 Description.............................................................................................................75 14. Recovery Scenario............................................................80 14.1 Exceptional Handling using Recovery Scenarios..................................................81 14.2 Sample for Recovery Scenario:...........................................................................87 15. Optional Steps...................................................................93 15.1 Description:........................................................................................................93 16. Reporting...........................................................................95 16.1 Different Options for Reporting.............................................................................96 16.2 Functions used for Reporting..............................................................................97 16.3 Reporting Formats.................................................................................................99

1. Automation Architecture1.1 Design

Confidential

Page 3 of 100

9510853.doc

QTPFrameWork

1.2

Approach for Test Automation

Description

Confidential

Page 4 of 100

9510853.doc

QTPFrameWork

Approach for Test Automation is used for building a strategy for automation starting from the Requirement phase till the deployment phase. Approach for automation begins with finding out the conditions and business rules given by the client and grouping similar conditions, business rules together as Test cases or Test Scenarios. Steps involved in Approach for Test Automation are as follows: Requirement gathering from the client Understanding and Analyzing the Requirement Grouping the requirement into Test cases Preparing the Design for Automation Building Scripts depending on the Design Review of Scripts at Offshore Delivery to the Client

For example in the Unilever project: Since it is Project for Automation of SAP, Team was divided into two, SAP Consultants. Testing Team. Requirement gathering from the client included knowledge transfer at onsite, where all the transactions including the customized transactions where explained to the SAP Consultants of satyam, Under standing of requirements was done at the client side, Depending on the flow of transactions, all the transactions where grouped together as different scenarios. While SAP Consultants where onsite for gathering Requirements, Work done at the offshore was to analyze on the appropriate version of the QTP Tool to be used and to get licenses for QTP, user accounts for SAP access, Installation of QTP and SAP. All the Identified Scenarios which consists of different transactions where explained to Testing Team. Then common functionalities where identified, and grouped together as different Test cases. After defining different Test cases, design for automation of scripts was done, where Reusability was one of the main aspects, where all the transactions, which are common in the scenarios, are identified as Reusable transactions.

Automation Framework: For Quality deliverables, important things that should be followed are:

Confidential

Page 5 of 100

9510853.doc

QTPFrameWork

Following common coding structure for all the scripts Consistent coding conventions Use of Reusability for making code efficient and minimal Efficient use of Object Repository Use of Error and Exception handling Functions Use of Data table object, Environment variables for using data

For example in the Unilever project: Coding Structure used is that there will a main Action for all the scripts which is named as corresponding Test case name, This Action intern wi

View more