HP QuickTest Professional Best Practices

download HP QuickTest Professional Best Practices

of 8

Transcript of HP QuickTest Professional Best Practices

  • 8/3/2019 HP QuickTest Professional Best Practices

    1/8

    www.orasi.com

    HP QuickTest Professional

    Best Practices Document

    HP SoftwarePlatinum Business Partner

  • 8/3/2019 HP QuickTest Professional Best Practices

    2/8

    HP QuickTest Professional Best Practices

    Orasi is a trademark of Orasi Software, Inc. All other products and company names are trademarks or registered

    trademarks of their respective owners.

    Information regarding Orasi products, services and offerings may be superseded by subsequent documents. For the

    latest information regarding Orasi and its products and services, please contact your local sales office or the corporate

    headquarters.

    2010 Orasi Software, Inc. All rights reserved. Unauthorized use, disclosure and distribution of this document are

    prohibited.

    Doc #: 10QP0210B

    Orasi Software, Inc.

    114 TownPark Drive, Suite 400 Kennesaw, Georgia 30144

    Tel 678.819.5300 Fax 678.819.5301

    www.orasi.com

    2010 Orasi Software, Inc. www.orasi.com Page 1

  • 8/3/2019 HP QuickTest Professional Best Practices

    3/8

    HP QuickTest Professional Best Practices

    Contents

    QuickTest Professional (QTP) Accelerated Implementation Roadmap ........................................................................ 3 1. Define Complexity of Design ............................................................................................................................. 32. Define Test-Automation Architecture ................................................................................................................ 3

    3. Define Conventions ............................................................................................................................................ 44. Standardize Action Appearance ......................................................................................................................... 45. Create Object Repository Files ........................................................................................................................... 56. Establish Test Data Sets ..................................................................................................................................... 57. Create Function Library ..................................................................................................................................... 58. Create Action Library ......................................................................................................................................... 69. Create Actions .................................................................................................................................................... 610. Define Recovery Scenarios .............................................................................................................................. 7

    2010 Orasi Software, Inc. www.orasi.com Page 2

  • 8/3/2019 HP QuickTest Professional Best Practices

    4/8

    HP QuickTest Professional Best Practices

    QuickTest Professional (QTP) Accelerated Implementation Roadmap

    This implementation roadmap consists of a methodology and best practices based on Orasis 15 + years of experience

    in implementing automated testing software. This is a scalable process that, when executed properly, delivers a rapid

    return on investment.

    1. Define Complexity of Design

    Best Practice Write robust test scripts with a very low level of complexity.

    Value Decreases maintenance costs. Encourages reusability. Test scripts can be handed off and maintained by junior or new members of the

    team with minimal effort.

    Task Define a level of test design complexity based on the QTP proficiency level of your

    QA/scripting team.

    Consideration & Rationale There exists a fine balance between automated script complexity and script

    robustness. Automated scripts have a tendency to be cast aside as time goes on and asemployees turn over. The reason for this is that many organizations write very

    complicated scripts that can only be maintained by the original creator of the script.

    Although they may be very robust, the knowledge of these scripts is not easily

    transferred.

    2. Define Test-Automation Architecture

    Best Practice Monitor test automation progress and proficiency.

    Value Knowledge of project progress and proficiency can be easily obtained at any point

    during the life a project lifecycle.

    Task Define test-automation architecture.

    Consideration & Rationale Orasis preferred architecture for test automation is QuickTest Professional for

    Quality Center. The Quality Center Architecture comes with many benefits, including

    modularity of test components, remote test execution, defect tracking, and

    requirements correlation with test cases, automated test scripts, defects and release

    cycles.

    At the outset it is important to know what information will be required to track and

    measure project progress and proficiency. A set of robust reports capable of

    delivering a wide variety of information on many items such as test execution status,

    automation percent complete, and defect trends should be defined at the outset of the

    testing initiative.

    2010 Orasi Software, Inc. www.orasi.com Page 3

  • 8/3/2019 HP QuickTest Professional Best Practices

    5/8

    HP QuickTest Professional Best Practices

    3. Define Conventions

    Best Practice Establish coding standards.

    Value Uniformity in your code improves the readability and facilitates change management

    in your test automation group, leading to an improved overall test script development

    process.

    Task Define scripting conventions.

    Consideration & Rationale Scripting conventions are a very important part of the development process of

    automated scripts. These scripting conventions should not only be implemented for

    one group in an enterprise organization, but all groups within an organization should

    adopt naming and coding conventions.

    Common Naming Conventions

    Date(Time) dtm dtm_payment_dateInteger int int_check#String str str_customer_nameCurrency cur cur_amount_paidCommand cmd cmd_payment_buttonBoolean bln bln_foundObjects: txtObjectName,lstObjectName,tnObjectNameVariables: varVariableName,envVariableNameDatasheets: dsDatasheetName

    4. Standardize Action Appearance

    Best Practice Use standard automated test script templates.

    Value Ease of maintenance. Reusability. Ease of knowledge transfer across projects.

    Task Standardize Action Appearance.

    Consideration & Rationale As all test cases should be written using standard templates, all automated test scripts

    should also be developed using standard templates. QTP allows the user to develop a

    template for the appearance of each Action within QTP. QTP captures a users

    interaction with an application and then houses the interaction as segments of code

    within an Action. Each Action typically will become a building block of a script that

    tests an outlined business process.

    2010 Orasi Software, Inc. www.orasi.com Page 4

  • 8/3/2019 HP QuickTest Professional Best Practices

    6/8

    HP QuickTest Professional Best Practices

    5. Create Object Repository Files

    Best Practice Maintain a robust test automation framework.

    Value Minimizes the amount of effort required to make a change to test scripts when the

    application under test changes.

    Task Create Object Repository Files.

    Consideration & Rationale QTP uses what HP has termed an Object Repository to house descriptions of each

    object in your application. This allows QTP to recognize each individual object

    during script execution. In order to build a robust test automation framework, the

    automation specialist must determine whether or not a shared object repository or a

    perAction object repository will be used. In most instances a shared object repository

    is the better choice because should any object property change in the application

    under test, a single change to the shared object repository will propagate the change to

    all test scripts. However, there may be cases where perAction repository files are

    preferable depending on the characteristics of the automation effort.

    6. Establish Test Data Sets

    Best Practice Develop a robust test data framework.

    Value Minimizes test data development and maintenance.

    Task Establish Test Data Sets.

    Consideration & Rationale The automation specialist should work with the business and application experts in

    order to determine the data needed to test each application. Factors that affect script

    development include determining whether or not a dataset the application uses can be

    refreshed, or will the script have to reset any data that was manipulated during

    execution. These questions need to be answered before development of automated

    scripts can begin.

    7. Create Function Library

    Best Practice Maintain data manipulation functions.

    Value Maximizes the use of reusable functions.

    Task Create Function Library.

    Consideration & Rationale In the process of reviewing and recording a business process, the automation

    specialist may encounter situations where data may need to be manipulated the same

    way on more than one occasion. If this is the case, a function which will provide the

    data manipulation should be created and stored in a function library so that it can be

    called multiple times by different test scripts.

    2010 Orasi Software, Inc. www.orasi.com Page 5

  • 8/3/2019 HP QuickTest Professional Best Practices

    7/8

    HP QuickTest Professional Best Practices

    8. Create Action Library

    Best Practice Segment the application under test into logical business components.

    Value Minimize maintenance effort and cost. Increase ease of knowledge transfer.

    Task Create Action Library.

    Consideration & Rationale The automation specialist should analyze the application under test with the

    application expert and break it down into small, logical business components. Each

    miniature business component should be scripted and provided as a building block of

    an entire business process. For example, Logging into the Application would be a

    business component for just about any business process. Business components should

    be logically stored in a Quality Center file hierarchy as Action libraries. Each one of

    these Actions should be labeled as a Reusable Action.

    9. Create Actions

    Best Practice Identify Regular and Reusable Actions.

    Value Minimizes the time required to create test scripts.

    Task Create Actions.

    Consideration & Rationale There are two main types of Actions: Regular Actions (NonReusable Actions), and

    Reusable Actions.

    Regular Actions (regular sub procedures) are actions that can be used only in thetest in which they were created, and only once.

    Reusable Actions are Actions that can be called by other Actions, either regularor reusable. Reusable Actions also have two types:

    Internal Actions are Reusable Actions that are created and used in the giventest on a local scope.

    External Actions are Reusable Actions that were created in another test asInternal Actions or Actions stored in an Action Library and are called by the

    given test.

    Once the Action library has been created, the automation specialist can call all of the

    different building blocks (Reusable Actions) in order to make up a full test.

    2010 Orasi Software, Inc. www.orasi.com Page 6

  • 8/3/2019 HP QuickTest Professional Best Practices

    8/8

    HP QuickTest Professional Best Practices

    2010 Orasi Software, Inc. www.orasi.com Page 7

    10. Define Recovery Scenarios

    Best Practice Identify verification routines and recovery procedures.

    Value Minimize the number of test failures.

    Task Define Recovery Scenarios.

    Consideration & Rationale Recovery Scenarios are scenarios that are invoked when an unexpected behavior

    happens. For example, during script execution, an unexpected popup window

    appears or the database locks up and the application freezes. The automation

    specialist should determine a set of potential issues that the script may encounter

    during execution. Once the potential issues have been determined, they must be

    entered into QTP so the tool knows what action to take when one of these unexpected

    error conditions is encountered. A number of actions can be taken, such as shutting

    down an application process and restarting it, or clicking a button on a popup

    window.

    Custom recovery scenarios can also be coded into QTP. For example, if an error is

    encountered during remote execution, Quality Center can close down all applications

    and move on to the next script execution.