You are previewing Advanced UFT 12 for Test Engineers Cookbook.
O'Reilly logo
Advanced UFT 12 for Test Engineers Cookbook

Book Description

Over 60 practical recipes to help you accomplish automation tasks using UFT 12 and VBScript

In Detail

UFT (QTP) is a functional test automation tool by HP that supports a wide array of technologies for both GUI and API testing. Advanced UFT 12 for Test Engineers Cookbook will provide you with simple solutions to quite complex tasks and leverage your skills in programming with VBScript.

Unlock the full potential of UFT 12 with an introduction to its new features and functionality. Learn the industry's best-kept secrets such as how to enhance toolset capabilities, which you never thought possible. Learn how to extend UFT 12 by overriding methods, perform DB and XML checks, and handle unexpected dialogs. We also cover the topics of object identification using descriptive programming, classes, utility and reserved objects, Windows Scripting Host (WSH), and most importantly API testing and building testware frameworks. This book is an invaluable source of reference for test engineers with clear and powerful coding examples.

What You Will Learn

  • Use code design patterns in test automation to improve maintenance
  • Identify objects using Object Repository as well as with descriptive programming to achieve object identification at runtime
  • Build an event handler to handle unexpected dialogs
  • Use the objects and methods of the Windows Script Host (WSH)
  • Build an automation framework that works for you
  • Unleash the power of API and SOA testing
  • Use and build UFT reserved objects
  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

    Table of Contents

    1. Advanced UFT 12 for Test Engineers Cookbook
      1. Table of Contents
      2. Advanced UFT 12 for Test Engineers Cookbook
      3. Credits
      4. About the Authors
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why subscribe?
          2. Free access for Packt account holders
          3. Instant updates on new Packt books
      7. Preface
        1. What this book covers
        2. What you will need for this book
        3. Who this book is for
          1. Sections
          2. Getting ready
          3. How to do it…
          4. How it works…
          5. There's more…
          6. See also
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      8. 1. Data-driven Tests
        1. Introduction
        2. Creating a DataTable parameter
          1. How to do it...
          2. How it works...
          3. See also
        3. Retrieving data from a DataTable
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Storing data in a DataTable
          1. How to do it...
          2. How it works…
          3. There's more...
          4. See also
        5. Importing an Excel file to a test
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        6. Exporting a DataTable
          1. How to do it...
          2. How it works...
          3. There's more...
        7. Parameterizing Test Object properties
          1. How to do it...
          2. There's more...
          3. See also
        8. Defining test cases using a DataTable
          1. Getting ready
          2. How to do it...
          3. How it works...
        9. Storing data in the Environment object
          1. How to do it...
          2. How it works...
          3. There's more...
          4. See also
        10. Retrieving data from the Environment object
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        11. Reading values from an INI file
          1. Getting ready
          2. How to do it...
        12. Using a configuration file to manage test environments
          1. Getting ready
          2. How to do it...
          3. How it works...
        13. Using a global dictionary for fast shared data access
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        14. Using a global dictionary for fast shared code access
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
      9. 2. Testing Web Pages
        1. Introduction
        2. Checking whether page links are broken
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        3. Deleting cookies
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Managing multiple browser windows
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Handling pop-up dialogs
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Downloading a file using XMLHttp
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Checking whether a website is up
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        8. Uploading a file using FTP
          1. Getting ready
          2. How to do it...
          3. How it works...
        9. Identifying elements based on anchors
          1. How to do it...
          2. How it works...
        10. Synchronizing a test with a web page loading
          1. How to do it...
          2. How it works...
        11. Accessing web elements through DOM
          1. How to do it...
          2. How it works...
          3. See also
      10. 3. Testing XML and Database
        1. Introduction
        2. Establishing and closing a database connection
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Using SQL queries programmatically
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Using a database checkpoint
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Using an XML checkpoint
          1. How to do it...
          2. How it works...
      11. 4. Method Overriding
        1. Introduction
        2. Overriding a Test Object method
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Number of function arguments
            2. Interoperability of registered functions
          5. See also
        3. Registering a method to all classes
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Using method overriding to support object subtypes
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        5. Adding a new method to a class
          1. How to do it...
          2. How it works...
          3. See also
      12. 5. Object Identification
        1. Introduction
        2. Setting mandatory and assistive properties for a class
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Using Descriptive Programming inline
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Using the Description object
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Using child objects
          1. How to do it...
          2. How it works...
        6. Using native properties for object identification
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. See also
        7. Identifying an object based on its parent
          1. How to do it...
          2. How it works...
      13. 6. Event and Exception Handling
        1. Introduction
        2. Catching errors inside a function or subroutine
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. Creating and using a recovery scenario
          1. How to do it...
          2. How it works...
        4. Using a global dictionary for recovery
          1. Getting ready
          2. How to do it...
          3. How it works...
      14. 7. Using Classes
        1. Introduction
        2. Implementing a class
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. Implementing a simple search class
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Implementing a generic Login class
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Implementing function pointers
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        6. Implementing a generic Iterator
          1. Getting ready
          2. How to do it...
          3. How it works...
      15. 8. Utility and Reserved Objects
        1. Introduction
        2. Using global variables (Environment)
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        3. Customizing mouse operations (DeviceReplay)
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Managing processes (SystemUtil)
          1. Getting ready
          2. How to do it…
        5. Measuring time (MercuryTimers)
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Resolving file locations (PathFinder)
          1. Getting ready
          2. How to do it…
          3. How it works…
        7. Loading shared object repositories (RepositoriesCollection)
          1. Getting ready
          2. How to do it…
          3. How it works...
        8. Loading and creating XML documents (XMLUtil)
          1. Getting ready
          2. How to do it...
        9. Drawing a rectangle on the screen with Win32 API methods (Extern)
          1. Getting ready
          2. How to do it…
          3. How it works…
        10. Verifying binary file contents (FileCompare)
          1. Getting ready
          2. How to do it...
          3. How it works...
        11. Implementing a custom reserved object
          1. How to do it…
          2. How it works…
        12. Using remote objects
          1. Getting ready
          2. How to do it…
          3. How it works…
        13. Utility statements
          1. Getting ready
          2. How to do it…
      16. 9. Windows Script Host
        1. Introduction
        2. Reading a key from the Windows® system registry
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Writing a key to the Windows® system registry
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Deleting a key from the Windows® system registry
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Running a process using the Windows® system shell
          1. Getting ready
          2. How to do it...
          3. How it works...
      17. 10. Frameworks
        1. Introduction to test automation frameworks
          1. Definition of a test automation framework
          2. Advantages of using a test automation framework
          3. Types of test automation frameworks
            1. Selecting a framework type
            2. Modular-driven framework
            3. Data-driven frameworks
            4. Keyword-driven frameworks
            5. Hybrid frameworks
        2. Designing a test automation framework
          1. Key design activities for a framework
          2. Components of a framework
            1. Controller
            2. Reusable components (actions)
            3. Event handler
            4. Reporter
        3. Building a test controller
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Building a reusable component (action)
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Building an event handler
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Building a test reporter
          1. Getting ready
          2. How to do it...
          3. How it works...
      18. A. Design Patterns
        1. Auxiliary classes and functions
        2. Action patterns
        3. Runtime data patterns
      19. Index