HP QuickTest Professional .NET Add-in Extensibility Software Version: 9.5 Developer’s Guide Manufacturing Part Number:T6513-90029 Document Release Date: January 2008 Software Release Date: January 2008 Legal Notices Warranty The only warranties for HP products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. HP shall not be liable for technical or editorial errors or omissions contained herein. The information contained herein is subject to change without notice. Restricted Rights Legend Confidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license. Third-Party Web Sites HP provides links to external third-party Web sites to help you find supplemental information. Site content and availability may change without notice. HP makes no representations or warranties whatsoever as to site content or availability. Copyright Notices © 1992 - 2008 Hewlett-Packard Development Company, L.P. Trademark Notices Adobe® and Acrobat® are trademarks of Adobe Systems Incorporated. Intel®, Pentium®, and Intel® Xeon™ are trademarks of Intel Corporation in the U.S. and other countries. Java™ is a US trademark of Sun Microsystems, Inc. Microsoft®, Windows®, Windows NT®, and Windows® XP are U.S registered trademarks of Microsoft Corporation. Oracle® is a registered US trademark of Oracle Corporation, Redwood City, California. Unix® is a registered trademark of The Open Group. SlickEdit® is a registered trademark of SlickEdit Inc. 2 Documentation Updates This manual’s title page contains the following identifying information: (cid:129) Software version number, which indicates the software version (cid:129) Document release date, which changes each time the document is updated (cid:129) Software release date, which indicates the release date of this version of the software To check for recent updates, or to verify that you are using the most recent edition of a document, go to: http://ovweb.external.hp.com/lpe/doc_serv/ 3 Support You can visit the HP Software Support Web site at: www.hp.com/go/hpsoftwaresupport HP Software online support provides an efficient way to access interactive technical support tools. As a valued support customer, you can benefit by using the support site to: (cid:129) Search for knowledge documents of interest (cid:129) Submit and track support cases and enhancement requests (cid:129) Download software patches (cid:129) Manage support contracts (cid:129) Look up HP support contacts (cid:129) Review information about available services (cid:129) Enter into discussions with other software customers (cid:129) Research and register for software training Most of the support areas require that you register as an HP Passport user and sign in. Many also require a support contract. To find more information about access levels, go to: http://h20230.www2.hp.com/new_access_levels.jsp To register for an HP Passport ID, go to: http://h20229.www2.hp.com/passport-registration.html 4 Table of Contents Welcome to This Guide.........................................................................7 How This Guide Is Organized...............................................................8 Who Should Read This Guide.............................................................10 QuickTest Professional Online Documentation.................................10 Additional Online Resources...............................................................12 Typographical Conventions................................................................14 Chapter 1: Introducing QuickTest Professional .NET Add-in Extensibility.....................................................................................15 Understanding .NET Add-in Extensibility..........................................16 Using the .NET Windows Forms Spy..................................................18 Understanding Coding Options: .NET DLL and XML........................19 Understanding Custom Server Run-Time Contexts...........................20 Understanding Test Object Mapping..................................................22 Chapter 2: Installing the QuickTest Professional .NET Add-in Extensibility SDK.............................................................................23 About Installing the QuickTest Professional .NET Add-in Extensibility SDK............................................................................24 Before You Install................................................................................25 Installing the QuickTest Professional .NET Add-in Extensibility SDK..................................................................................................25 Repairing the QuickTest Professional .NET Add-in Extensibility SDK Installation..............................................................................27 Uninstalling the QuickTest Professional .NET Add-in Extensibility SDK..................................................................................................28 5 Table of Contents Chapter 3: Using a .NET DLL to Extend Support for a Custom Control...............................................................................29 About Using a .NET DLL to Extend Support for a Custom Control...30 Creating a Custom Server....................................................................30 Using the XML Configuration Segment.............................................36 Implementing Test Record for a Custom Control Using the .NET DLL.........................................................................................36 Implementing Test Run for a Custom Control Using the .NET DLL.........................................................................................41 Running Code under Application Under Test from the QuickTest Context..........................................................................43 API Overview.......................................................................................44 Chapter 4: Using an XML File to Extend Support for a Custom Control47 About Using an XML File to Extend Support for a Custom Control.48 Understanding the Control Definition XML File...............................48 Example of a Control Definition XML File.........................................51 Chapter 5: Using Test Object Configuration Files..............................53 About Using Test Object Configuration Files.....................................53 Guidelines for Implementing Test Object Configuration Files..........54 Understanding the Test Object Configuration File............................58 Deploying the Test Object Configuration File....................................60 Chapter 6: Configuring QuickTest to Use the Custom Server...........61 About Configuring QuickTest to Use the Custom Server...................61 Understanding the QuickTest System Windows Forms Configuration File...........................................................................62 Chapter 7: Tutorial - Step-by-Step Basic Example..............................67 Creating a New Custom Server Project...............................................68 Implementing Test Record Logic........................................................71 Implementing Test Run Logic.............................................................72 Configuring QuickTest Professional...................................................73 Testing the Custom Server..................................................................76 Understanding the TrackBarSrv.cs File...............................................76 Chapter 8: Tutorial - Advanced Example............................................79 Toolbar Example.................................................................................79 Understanding the ToolBarSrv.cs File.................................................87 Index....................................................................................................91 6 Welcome to This Guide Welcome to QuickTest Professional .NET Add-in Extensibility. QuickTest Professional .NET Add-in Extensibility is an SDK (Software Development Kit) package that enables you to support testing applications using third-party and custom .NET controls that are not supported out-of- the-box by the QuickTest Professional .NET Add-in. This chapter includes: ➤ How This Guide Is Organized onpage8 ➤ Who Should Read This Guide onpage10 ➤ QuickTest Professional Online Documentation onpage10 ➤ Additional Online Resources onpage12 ➤ Typographical Conventions onpage14 ➤ Typographical Conventions onpage14 7 Welcome to This Guide How This Guide Is Organized This guide explains how to set up and use QuickTest Professional .NET Add-in Extensibility to extend QuickTest support for third-party and custom .NET controls. This guide assumes you are familiar with QuickTest functionality and should be used together with the QuickTest Professional .NET Add-in Extensibility API Reference provided in online Help format with the SDK installation (Start > Programs > QuickTest Professional > Extensibility > Documentation > .NET Add-in Extensibility Help). These documents should also be used in conjunction with the HPQuickTest Professional User’s Guide, the .NET section of the HPQuickTest Professional Add-ins Guide, and the HPQuickTest Professional Object Model Reference. These guides can be accessed online by choosing Help > QuickTest Professional Help from the QuickTest main window. This guide contains: Chapter 1 Introducing QuickTest Professional .NET Add-in Extensibility Explains the concepts of extending support to custom .NET controls. Chapter 2 Installing the QuickTest Professional .NET Add-in Extensibility SDK Explains how to install the QuickTest .NET Add-in Extensibility SDK and what the SDK contains. Chapter 3 Using a .NET DLL to Extend Support for a Custom Control Explains how to extend support for a custom control using a .NET DLL. Chapter 4 Using an XML File to Extend Support for a Custom Control Explains how to extend support for a custom control using an XML file. Chapter 5 Using Test Object Configuration Files Explains how to use test object configuration files to enable additional functionality for custom methods and properties. 8 Welcome to This Guide Chapter 6 Configuring QuickTest to Use the Custom Server Explains how to configure QuickTest to use the Custom Server and describes the configuration file format. Chapter 7 Tutorial - Step-by-Step Basic Example Provides instructions and leads you step-by-step through the process of creating custom support for a control. Chapter 8 Tutorial - Advanced Example Provides instructions for creating custom support for a control that requires more complex support implementation. Note: The information, examples, and screen captures in this guide focus specifically on working with QuickTest tests. However, much of the information applies equally to components. Business components and scripted components are part of HP Business Process Testing, which utilizes a keyword-driven methodology for testing applications. For more information, see the HPQuickTest Professional User’s Guide and the HPQuickTest Professional for Business Process Testing User’s Guide. 9 Welcome to This Guide Who Should Read This Guide This guide is intended for programmers, QA engineers, systems analysts, system designers, and technical managers who want to extend QuickTest support for .NET custom controls. To use this guide, you should be familiar with: ➤ Major QuickTest features and functionality ➤ QuickTest Professional Object Model ➤ QuickTest Professional .NET Add-in ➤ .NET Programming in C# or Visual Basic ➤ XML (basic knowledge) QuickTest Professional Online Documentation QuickTest Professional includes the following online documentation: Readme provides the latest news and information about QuickTest. Choose Start > Programs > QuickTest Professional > Readme. QuickTest Professional Installation Guide explains how to install and set up QuickTest. Choose Help > Printer-Friendly Documentation > HPQuickTest Professional Installation Guide. QuickTest Professional Tutorial teaches you basic QuickTest skills and shows you how to design tests for your applications. Choose Help > HPQuickTest Professional Tutorial. Product Feature Movies provide an overview and step-by-step instructions describing how to use selected QuickTest features. Choose Help > Product Feature Movies. Printer-Friendly Documentation displays the complete documentation set in Adobe portable document format (PDF). Online books can be viewed and printed using Adobe Reader, which can be downloaded from the Adobe Web site (http://www.adobe.com). Choose Help > Printer-Friendly Documentation. 10
Description: