Mercury QuickTest Professional New Features Guide 8.2

Mercury QuickTest Professional
New Features Guide
Version 8.2
Mercury QuickTest Professional New Features Guide, Version 8.2
This manual, and the accompanying software and other documentation, is protected by U.S. and
international copyright laws, and may be used only in accordance with the accompanying license
agreement. Features of the software, and of other products and services of Mercury Interactive
Corporation, may be covered by one or more of the following patents: U.S. Patent Nos. 5,701,139;
5,657,438; 5,511,185; 5,870,559; 5,958,008; 5,974,572; 6,138,157; 6,144,962; 6,205,122; 6,237,006;
6,341,310; 6,360,332, 6,449,739; 6,470,383; 6,477,483; 6,549,944; 6,560,564; 6,564,342; 6,587,969;
6,631,408; 6,631,411; 6,633,912; 6,694,288; 6,738,813; 6,738,933 and 6,754,701. Other patents
pending. All rights reserved.
Mercury, Mercury Interactive, the Mercury Interactive logo, LoadRunner, LoadRunner TestCenter,
Mercury Business Process Testing, Mercury Quality Center, Quality Center, QuickTest Professional,
SiteScope, SiteSeer, TestDirector, Topaz and WinRunner are trademarks or registered trademarks of
Mercury Interactive Corporation or its subsidiaries, in the United States and/or other countries. The
absence of a trademark from this list does not constitute a waiver of Mercury Interactive's intellectual
property rights concerning that trademark.
All other company, brand and product names are registered trademarks or trademarks of their
respective holders. Mercury Interactive Corporation disclaims any responsibility for specifying which
marks are owned by which companies or which organizations.
Mercury Interactive Corporation
379 North Whisman Road
Mountain View, CA 94043
Tel: (650) 603-5200
Toll Free: (800) TEST-911
Customer Support: (877) TEST-HLP
Fax: (650) 603-5300
© 2004 Mercury Interactive Corporation, All rights reserved
If you have any comments or suggestions regarding this document, please send them via e-mail to
documentation@mercury.com.
QTPNFG8.2/01
Table of Contents
Welcome to QuickTest Professional 8.2................................................v
Using This Guide ...................................................................................v
QuickTest Documentation Set ............................................................vii
Online Resources .................................................................................vii
Documentation Updates ......................................................................ix
Typographical Conventions..................................................................x
Chapter 1: Introducing QuickTest Professional 8.2 ..............................1
About Introducing QuickTest Professional 8.2 .....................................2
What’s New in QuickTest Professional 8.2 ...........................................3
Understanding QuickTest Professional Terminology ...........................4
Introducing Business Process Testing ...................................................6
Chapter 2: Getting Started with Business Components in
QuickTest Professional .......................................................................9
About Getting Started with Business Components in
QuickTest Professional .....................................................................10
Connecting to Your Quality Center Project ......................................12
The Business Component Keyword View at a Glance ........................16
Understanding the Business Component Keyword View
Columns ...........................................................................................17
Setting Keyword View Display Options ..............................................19
Using QuickTest Commands for Business Components ....................22
Chapter 3: Working with Application Areas .......................................25
About Working with Application Areas..............................................26
Creating an Application Area..............................................................28
Managing the Shared Object Repository.............................................30
Saving an Application Area .................................................................35
Opening an Application Area..............................................................38
Deleting an Application Area ..............................................................39
iii
Table of Contents
Chapter 4: Working with Business Components................................41
About Working with Business Components.......................................41
Creating a New Business Component.................................................43
Saving a Business Component ............................................................46
Opening an Existing Business Component ........................................48
Chapter 5: Working with Scripted Components ................................51
About Working with Scripted Components .......................................52
Creating a Scripted Component .........................................................53
Chapter 6: Working with the Business Component
Keyword View...................................................................................57
About Working with the Business Component Keyword View .........58
Adding a Step to Your Component.....................................................59
Selecting an Item for Your Step ..........................................................62
Selecting the Operation for Your Step ................................................67
Defining Values for Your Step Arguments ..........................................69
Defining an Output Value for Your Step ............................................70
Working with Parameters....................................................................73
Working with Comments ...................................................................81
Managing Component Steps...............................................................83
Chapter 7: Defining Business Component and
Application Area Settings.................................................................85
About Working with Business Component and
Application Area Settings .................................................................86
Accessing the Settings Dialog Boxes ...................................................87
Defining Properties for Your Component or Application Area ..........90
Defining a Snapshot for Your Component.........................................96
Defining Application Settings for Your Component or
Application Area...............................................................................98
Defining Resources for Your Component or Application Area ........101
Defining Parameters for Your Component .......................................103
Defining Recovery Scenario Settings for Your Component or
Application Area.............................................................................106
Chapter 8: Working with User-Defined Functions ...........................109
About Working with User-Defined Functions ..................................110
Using the Function Definition Generator ........................................112
Additional Tips for Working With User-Defined Functions ............125
Working with Associated Library Files..............................................127
Index..................................................................................................133
iv
Welcome to QuickTest Professional 8.2
Welcome to QuickTest Professional, the Mercury automated keyword-driven
testing solution. QuickTest provides everything you need to quickly create,
run, and debug tests and components.
Using This Guide
This guide describes how to use QuickTest to create and manage business
components using the Business Component Keyword View, and how to
create scripted components. It also describes how to create and manage the
application areas on which components are based, and how to define the
various resource files used by components. In addition, it explains how to
use the Function Definition Generator to create user-defined functions and
register them to test objects in your test or component.
Note: This guide specifically describes the features that were introduced or
enhanced in QuickTest Professional 8.2. For general information about
using QuickTest, refer to the QuickTest Professional User’s Guide 8.0 or 8.0.1.
v
Welcome
This guide contains the following chapters:
Chapter 1
Introducing QuickTest Professional 8.2
Provides an overview of the new features provided in QuickTest 8.2, an
explanation of the various user roles, and a list of the QuickTest terms used
in this guide.
Chapter 2
Getting Started with Business Components in QuickTest Professional
Describes how to connect to a Quality Center project with Business Process
Testing support and introduces the Business Component Keyword View.
Chapter 3
Working with Application Areas
Describes how to create and work with an application area, and how to
manage the shared object repository.
Chapter 4
Working with Business Components
Describes how to create and manage business components.
Chapter 5
Working with Scripted Components
Describes how to create scripted components.
Chapter 6
Working with the Business Component Keyword View
Describes how to add steps to a business component and define their
content using the Business Component Keyword View. It also describes how
to add comments to your business component.
Chapter 7
Defining Business Component and Application Area Settings
Describes how to define settings and resources for your business
components and application areas.
Chapter 8
Working with User-Defined Functions
Describes how to define user-defined functions to add additional
functionality to your tests and components.
vi
Welcome
QuickTest Documentation Set
In addition to this New Features Guide, QuickTest Professional comes with
the following printed documentation:
QuickTest Professional Installation Guide explains how to install QuickTest
Professional.
QuickTest Professional Tutorial teaches you basic QuickTest skills and shows
you how to design tests for your applications.
QuickTest Professional User’s Guide provides step-by-step instructions for
using QuickTest Professional to test your applications.
QuickTest Professional Shortcut Key Reference Card provides a list of
commands that you can execute using shortcut keys.
Online Resources
QuickTest Professional includes the following online resources:
Readme (available from the QuickTest Professional Start menu program
folder) provides the latest news and information about QuickTest
Professional.
What’s New in QuickTest Professional (available from Help > What’s New in
QuickTest) describes the newest features, enhancements, and supported
environments in this latest version of QuickTest Professional.
Printer-Friendly Documentation displays the complete documentation set in
Adobe portable document format (PDF). Online books can be read and
printed using Adobe Reader, which can be downloaded from the Adobe Web
site (http://www.adobe.com).
QuickTest Professional Tutorial (available from the QuickTest Professional
Welcome window, the Help menu, and the QuickTest Professional Start
menu program folder) teaches you basic QuickTest skills and shows you how
to start designing tests for your applications.
vii
Welcome
QuickTest Professional Context-Sensitive Help (available from specific dialog
boxes and windows) describes QuickTest dialog boxes and windows.
QuickTest Professional New Features Guide (available from Help > QuickTest
Professional Help) provides step-by-step instructions for working with
business components and application areas in QuickTest Professional. It
also describes how to use the Function Definition Generator to create
user-defined functions and register them to test objects in your test or
component.
QuickTest Professional User’s Guide (available from Help > QuickTest
Professional Help) provides step-by-step instructions for using QuickTest
Professional to test your applications.
QuickTest Professional Object Model Reference (available from Help >
QuickTest Professional Help) describes QuickTest Professional test objects,
lists the methods and properties associated with each object, and provides
syntax information and examples for the methods.
QuickTest Professional Automation Object Model Reference (available from
the QuickTest Professional Start menu program folder and from Help >
QuickTest Automation Object Model Reference) provides syntax, descriptive
information, and examples for the automation objects, methods, and
properties. It also contains a detailed overview to help you get started
writing QuickTest automation scripts. The automation object model assists
you in automating test or component management, by providing objects,
methods and properties that enable you to control virtually every QuickTest
feature and capability.
VBScript Reference (available from Help > QuickTest Professional Help)
contains Microsoft VBScript documentation, including VBScript, Script
Runtime, and Windows Script Host.
Mercury Tours sample Web site (available from the QuickTest Professional
Start menu program folder and also available from the QuickTest
Professional Record and Run Settings dialog box) and the Mercury Tours
Windows sample flight application (available from the QuickTest
Professional Start menu program folder) are the basis for many examples in
this book. The URL for this Web site is http://newtours.mercuryinteractive.com.
viii
Welcome
Customer Support Online (available from Help > Customer Support Online)
uses your default Web browser to open the Mercury Customer Support Web
site. This site enables you to browse the knowledge base and add your own
articles, post to and search user discussion forums, submit support requests,
download patches and updated documentation, and more. The URL for this
Web site is http://support.mercury.com.
Send Feedback (available from Help > Send Feedback) enables you to send
online feedback about QuickTest Professional to the product team.
Mercury Interactive on the Web (available from Help > Mercury Interactive
on the Web) uses your default Web browser to open the Mercury home
page. This site provides you with the most up-to-date information on
Mercury and its products. This includes new software releases, seminars and
trade shows, customer support, educational services, and more. The URL for
this Web site is http://www.mercury.com.
Documentation Updates
Mercury Interactive is continuously updating its product documentation
with new information. You can download the latest version of this
document from the Customer Support Web site (http://support.mercury.com).
To download updated documentation:
1 In the Customer Support Web site, click the Documentation link.
2 Under Select Product Name, select QuickTest Professional.
Note that if QuickTest Professional does not appear in the list, you must add
it to your customer profile. Click My Account to update your profile.
3 Click Retrieve. The Documentation page opens and lists the documentation
available for the current release and for previous releases. If a document was
recently updated, Updated appears next to the document name.
4 Click a document link to download the documentation.
ix
Welcome
Typographical Conventions
This book uses the following typographical conventions:
x
1, 2, 3
Bold numbers indicate steps in a procedure.
>
The greater-than sign separates menu levels (for example,
File > Open).
Stone Sans
The Stone Sans font indicates names of interface
elements (for example, the Run button) and other items
that require emphasis.
Bold
Bold text indicates method or function names.
Italics
Italic text indicates method or function arguments and
book titles. It is also used when introducing a new term.
<>
Angle brackets enclose a part of a file path or URL address
that may vary from user to user (for example, <MyProduct
installation path>\bin).
Arial
The Arial font is used for examples and text that is to be
typed literally.
Arial bold
The Arial bold font is used in syntax descriptions for text
that should be typed literally.
SMALL CAPS
The SMALL CAPS font indicates keyboard keys.
...
In a line of syntax, an ellipsis indicates that more items of
the same format may be included. In a programming
example, an ellipsis is used to indicate lines of a program
that were intentionally omitted.
[ ]
Square brackets enclose optional arguments.
|
A vertical bar indicates that one of the options separated
by the bar should be selected.
1
Introducing QuickTest Professional 8.2
Welcome to QuickTest Professional, the Mercury advanced keyword-driven
testing solution.
This guide specifically describes the features that were introduced or
enhanced in QuickTest Professional 8.2. For general information about
using QuickTest, refer to the QuickTest Professional User’s Guide 8.0 or 8.0.1.
This chapter describes:
➤ About Introducing QuickTest Professional 8.2
➤ What’s New in QuickTest Professional 8.2
➤ Understanding QuickTest Professional Terminology
➤ Introducing Business Process Testing
1
Chapter 1 • Introducing QuickTest Professional 8.2
About Introducing QuickTest Professional 8.2
Welcome to QuickTest Professional, the Mercury automated,
keyword-driven, testing solution. By mirroring end-user behavior, QuickTest
Professional creates interactive customizable tests or components that
simplify and shorten the testing cycle.
QuickTest Professional enables you to test standard Windows applications,
Web objects, ActiveX controls, and Visual Basic applications. You can also
acquire additional QuickTest add-ins for a number of special environments,
such as Java, Oracle, SAP Solutions, .NET Windows and Web Forms, Siebel,
PeopleSoft, and terminal emulator applications. For more information, refer
to the QuickTest Professional Installation Guide.
Using the new QuickTest Professional Function Definition Generator, you
can easily create user-defined functions and add them to your test or
component. You can also use the Function Definition Generator to register
user-defined functions to test objects.
When QuickTest Professional is connected to a Quality Center project with
Business Process Testing support, you can define and manage the resources
that are needed to create and work with business components. You can also
create and debug business components using the intuitive, keyword-driven
Business Component Keyword View (although this is generally done by
Subject Matter Experts using Quality Center).
Note: Mercury Business Process Testing is fully integrated with QuickTest
and Quality Center, and is enabled if your license includes Business Process
Testing support.
2
Chapter 1 • Introducing QuickTest Professional 8.2
What’s New in QuickTest Professional 8.2
This section describes what’s new in QuickTest Professional 8.2.
➤ New Keyword View—Provides component-specific options that are
specially designed to facilitate the creation of business components.
➤ Updated Keyword View steps—Displays the individual steps that
comprise a component, in the order in which they are implemented and
at the same hierarchical level.
➤ New comment field row—Enables you to add manual steps to business
components, even before your application is ready to be tested, as well as
enter pertinent information about component steps.
➤ New Documentation Only view—Enables you to instruct QuickTest
Professional to display only the Documentation column of the Keyword
View, including any comments. This is especially useful for viewing and
printing components for use in manual testing.
➤ Multiple application areas—QuickTest enables you to create and use
multiple application areas, which can be used for various parts of your
application. Application areas (formerly known as business component
templates) specify the settings and resources to be used by one or more
business components. Each business component can be associated with a
specific application area, or share an application area with other business
components.
➤ New Local parameter type—Enables you to create a parameter that is
accessible only to the current business component. This is especially
useful if you want to use an output parameter for one step as an input
parameter for a later step in the same component.
➤ New Function Definition Generator—Enables you to quickly document
and register new user-defined functions. Registered functions are now
added automatically to the Keyword View. You can easily add a
description and auto-documentation line using the new Function
Definition Generator. Adding user-defined functions provides access to a
variety of additional operations for a component, for example, open an
application at the start of a business component or check the value of a
specific property.
3
Chapter 1 • Introducing QuickTest Professional 8.2
Understanding QuickTest Professional Terminology
The following terminology, specific to QuickTest Professional, is used in this
guide:
Keyword View—A Keyword View enables tests and components to be
created, viewed, and debugged using a keyword-driven, modular, table
format. QuickTest automatically modifies the columns and options in the
Keyword View to suit the specific needs of the document type (test or
component) on which you are currently working.
Steps—A step represents an operation to be performed. QuickTest provides
keywords that help you define steps quickly and easily.
The following terminology, specific to business components, is used in this
guide:
Business Component (or Component)—An easily-maintained, reusable unit
comprising one or more steps that perform a specific task. Business
components may require input values from an external source or from other
components, and they can return output values to other components.
Business Process Test—A scenario comprising a serial flow of business
components, designed to test a specific business process of an application.
Component Input Parameters—Variable values that a business component
can receive and use as the values for specific, parameterized steps in the
component. A component parameter may be accessed by any component in
the Quality Center project.
Component Output Parameters—Values that a business component can
return. These values can be viewed in the business process test results and
can also be used as input for a component that is used later in the test. A
component parameter may be accessed by any component in the Quality
Center project.
4
Chapter 1 • Introducing QuickTest Professional 8.2
Local Input Parameters—Variable values that an operation or a business
component step can receive and use as the values for specific, parameterized
steps in the component. A local parameter can only be accessed by the
component in which it defined.
Local Output Parameters—Values that an operation or a business
component step can return. These values can be viewed in the business
process test results and can also be used as input for a later step in the
component. A local parameter can only be accessed by the component in
which it defined.
QuickTest Engineer—An expert in QuickTest Professional automated testing.
The QuickTest Engineer defines and manages the resources that are needed
to create and work with business components. The QuickTest Engineer
creates application areas that specify all of the resources and settings needed
to enable Subject Matter Experts to create business components and
business process tests in Quality Center. The QuickTest Engineer can create
and modify function library files (such as VBScript library files), and
populate the shared object repository with test objects that represent the
different objects in the application being tested. The QuickTest Engineer can
also create and debug business components in QuickTest.
Roles—The various types of users who are involved in Business Process
Testing.
Subject Matter Expert—A person who has specific knowledge of the
application logic, a high-level understanding of the entire system, and a
detailed understanding of the individual elements and tasks that are
fundamental to the application being tested. The Subject Matter Expert uses
Quality Center to create business components and business process tests.
5
Chapter 1 • Introducing QuickTest Professional 8.2
Introducing Business Process Testing
One of the major enhancements in QuickTest Professional 8.2 focuses on
Business Process Testing. Business Process Testing utilizes a new keyworddriven methodology for testing, based on the creation and implementation
of business components in business process tests. Each reusable modular
business component tests a specific part (task) of an application. Using
keyword-driven testing, Subject Matter Experts, who have a keen
understanding of the individual parts of the application under test, use the
Business Components and Test Plan modules in Quality Center to create
and combine these components. Subject Matter Experts can design quality
assurance business process tests early in the development cycle and in a
script-free environment. They can then run and analyze these tests and test
sets in Quality Center. For more information, refer to the Business Process
Testing User’s Guide.
Each business component is based on an application area that provides it
with settings and links to specific resource files, such as function library
files, shared object repositories that contain the test objects used by the
application, associated add-ins, and recovery scenario files.
Using QuickTest Professional, you (the QuickTest Engineer who is an expert
in QuickTest Professional automated testing) create application areas by
defining the resources required by components. For example, you can create
and modify function library files that contain user-defined functions
(operations). You can also populate each shared object repository with test
objects for the specific part of the application being tested.
You can create multiple application areas—each focusing on a particular
part of the application under test. For example, for a flight reservation
application, you could create one application area for the login window,
another application area for the flight search module, another for the flight
reservation module, and still another for the billing module.
6
Chapter 1 • Introducing QuickTest Professional 8.2
After you create the required files, you store these resource files in the
Quality Center project, and reference them from the application area. When
a Subject Matter Expert working in Quality Center creates a new business
component, a local copy of the resource links and settings defined in the
application area is saved with the component, enabling it complete access to
these resources during the component design process and during run-time.
This guide describes the activities that the QuickTest Engineer performs
when working with application areas and components.
7
Chapter 1 • Introducing QuickTest Professional 8.2
8
2
Getting Started with Business
Components in QuickTest Professional
When your QuickTest Professional licence includes Business Process Testing
support, you can connect QuickTest to your Quality Center project. This
enables you to use the Business Component Keyword View to set up the
resources and settings for business components, and to create, view, and
debug business components in an intuitive, keyword-driven, modular table
format.
Note: Before you can debug components in QuickTest, you must enable
integration between QuickTest and your Quality Center project by selecting
the Allow other Mercury products to run tests and components check box
(from QuickTest, choose Tools > Options > Run).
This chapter describes:
➤ About Getting Started with Business Components in QuickTest Professional
➤ Connecting to Your Quality Center Project
➤ The Business Component Keyword View at a Glance
➤ Understanding the Business Component Keyword View Columns
➤ Setting Keyword View Display Options
➤ Using QuickTest Commands for Business Components
9
Chapter 2 • Getting Started with Business Components in QuickTest Professional
About Getting Started with Business Components in
QuickTest Professional
The first time you connect QuickTest to a Quality Center server and project,
QuickTest sets up default Business Process Testing folders and files in your
project. This enables you (the QuickTest Engineer) to prepare the assets
needed for business components, as well as create, work with, and debug
business components using the intuitive, keyword-driven Keyword View.
You prepare the assets for business components by creating application areas.
An application area comprises all of the required settings and resources to
enable the Subject Matter Expert to create a component. This includes all of
the test objects (stored in the shared object repository), all resource library
files, recovery scenarios, associated add-ins, and other information. You
provide a self-explanatory name and description for each application area,
enabling the Subject Matter Expert to select the application area that is bestsuited for each component.
Note: In earlier QuickTest Professional versions, application areas were
known as business component templates.
You can create as many application areas as required, depending on the
complexity and stage of development of the application you are testing. For
a simple application or for one window or Web page, for example, one
application area may be all that is needed. For complex or modular
applications with multiple windows or Web pages, it may be more
appropriate to create an application area for each module, window, dialog
box, or Web page.
10
Chapter 2 • Getting Started with Business Components in QuickTest Professional
Subject Matter Experts can then use the keyword-driven Steps tab provided
in Quality Center Business Components module to create a business
component, without the need for any programming knowledge. The Subject
Matter Expert associates the component with an application area, and then
begins to add individual steps to the component. For each step, the Subject
Matter Expert selects an item, which can be either a test object or an
operation (from a user-defined function library file). Based on the selected
item, the Subject Matter Expert adds additional content to the step by
selecting the operation to perform on the object, and defining any necessary
values for the selected operation. Each step appears as one row in the Steps
tab. Steps are documented automatically, enabling the user to view a
description of the component in easily understandable sentences.
The Keyword View even enables Subject Matter Experts to add manual steps
before the application is ready to be tested. This is done by adding
comments, which are free-text entries. Each comment serves as a manual step
in the component. Subject Matter Experts can mix and match entries by
including both component steps and comments, thereby ensuring that
every aspect of the application to be tested is covered, even before it is ready
to be tested.
11
Chapter 2 • Getting Started with Business Components in QuickTest Professional
Connecting to Your Quality Center Project
To work with business components, you must first connect QuickTest to a
Quality Center server. This server handles the connections between
QuickTest and the Quality Center project. Then you choose the Quality
Center project that you want QuickTest to access. The project stores
component and run session information for the Web site or application you
are testing. Note that Quality Center projects are password protected, so you
must provide a user name and a password.
To connect QuickTest to your Quality Center project:
1 Choose Tools > Quality Center Connection or click the Quality Center
Connection toolbar button. The Quality Center Connection dialog box
opens.
2 In the Server box, type the URL address of the Web server where Quality
Center is installed.
12
Chapter 2 • Getting Started with Business Components in QuickTest Professional
Note: You can choose a Web server accessible via a Local Area Network
(LAN) or a Wide Area Network (WAN).
3 In the Server connection area, click Connect. After the connection to the
server is established, the server’s name is displayed in read-only format in
the Server box.
4 In the Domain box, select the domain that contains the Quality Center
project.
5 In the Project box, select the project with which you want to work.
6 In the User name box, type a user name for opening the selected project.
7 In the Password box, type the password for the selected project.
8 In the Project connection area, click Connect to connect QuickTest to the
selected project.
After the connection to the selected project is established, the fields in the
Project connection area are displayed in read-only format.
9 To automatically reconnect to the Quality Center server and the selected
project the next time you open QuickTest, select the Reconnect on startup
check box.
If you do not select the Reconnect on startup check box, you will be
prompted to connect to a Quality Center project the next time you try to
create or open a business component or application area.
10 If the Reconnect on startup check box is selected, then the Save password
for reconnection on startup check box is enabled. To save your password for
reconnection on startup, select the Save password for reconnection on
startup check box.
If you do not save your password, you will be prompted to enter it when
QuickTest connects to Quality Center on startup.
13
Chapter 2 • Getting Started with Business Components in QuickTest Professional
Note: The first time you connect to a Quality Center server, QuickTest sets
up default Business Process Testing folders and files in your Quality Center
project.
11 Click Close to close the Quality Center Connection dialog box. The Quality
Center icon is displayed on the status bar to indicate that QuickTest is
currently connected to a Quality Center project.
Tip: To view the current Quality Center connection, point to the Quality
Center icon on the status bar. A tooltip displays the Quality Center server
name and project to which QuickTest is connected. To reopen the Quality
Center Connection dialog box, double-click the Quality Center icon on the
status bar.
Disconnecting QuickTest from Quality Center
You can disconnect from a Quality Center project or from a Quality Center
Web server. Note that if you disconnect QuickTest from a Web server
without first disconnecting from a project, QuickTest’s connection to that
project database is automatically disconnected.
Note: If a business component, application area, or shared file (such as a
shared object repository) is open when you disconnect from Quality Center,
then QuickTest closes it.
14
Chapter 2 • Getting Started with Business Components in QuickTest Professional
To disconnect QuickTest from Quality Center:
1 Choose Tools > Quality Center Connection or click the Quality Center
Connection toolbar button. You can also double-click the Quality Center
icon on the status bar. The Quality Center Connection dialog box opens.
2 To disconnect QuickTest from the selected project, in the Project connection
area, click Disconnect. You can now connect to a different project on the
Web server, if needed.
3 To disconnect QuickTest from the selected Web server, in the Server
connection area, click Disconnect.
4 Click Close to close the Quality Center Connection dialog box.
15
Chapter 2 • Getting Started with Business Components in QuickTest Professional
The Business Component Keyword View at a Glance
The Business Component Keyword View is comprised of a table-like view, in
which each step is a separate row in the table, and each column represents
different parts of the steps. You can modify the columns displayed to suit
your requirements. For more information, see “Setting Keyword View
Display Options” on page 19.
Keyword View columns
Step
You can add steps to the component manually or by recording the steps you
perform on your application. During a recording session, each step is
recorded as a row in the Keyword View. For example, the Keyword View
could contain the following rows:
These rows show the steps that are performed on the Welcome: Mercury
Tours page of the Mercury Tours sample web site:
➤ Mercury is entered in the userName edit box.
➤ The encrypted string 4129e9544fe92be22d38ebcb7cf5 is entered in the
password edit box.
➤ The Sign-In image is clicked.
The Documentation column translates each of the steps into
understandable sentences.
16
Chapter 2 • Getting Started with Business Components in QuickTest Professional
Tip: You can print the contents of the Keyword View to your Windows
default printer, or preview it on screen before printing. For more
information, refer to the QuickTest Professional User’s Guide.
Understanding the Business Component Keyword View
Columns
The Business Component Keyword View can contain any of the following
columns: Item, Operation, Value, Output, and Documentation. A brief
description of each column is provided below. For more detailed
information on each column, see “Adding a Step to Your Component” on
page 59.
Note: If you do not see one or more of the columns described below in your
Keyword View, you can use the Keyword View Options dialog box to display
them. For more information, see “Setting Keyword View Display Options”
on page 19.
Item Column
The test object on which you want to perform the step or Operation, which
enables you to choose an operation from a user-defined function library file.
You choose the item from a drop-down list, which displays the Operation
item and all child test objects for the previous step. If no child test objects
are available, the sibling test objects are displayed. For example, if the
previous step specifies the “user name” object, the “password” test object
might be displayed for the next step.
17
Chapter 2 • Getting Started with Business Components in QuickTest Professional
You can choose additional test objects from the object repository tree or
directly from the application you want to test. For more information, see
“Selecting an Item for Your Step” on page 62. For information on managing
the test objects in the shared object repository, see “Managing the Shared
Object Repository” on page 30.
If you want to add a comment or manual step to your component, you can
choose Comment from the Item column. This adds a comment row to the
Keyword View. Comments are displayed in a free text cell that extends the
entire width of the row, and are no longer part of the Item column.
Operation Column
The operation to be performed on the item. This column contains a list of
commonly used operations (methods, functions, and sub-procedures) that
can be performed on the item selected in the Item column, for example,
Click and Select. The most commonly used operation for the item selected
in the Item column is displayed by default. For more information, see
“Selecting the Operation for Your Step” on page 67. You can define
additional operations for a test object using the RegisterUserFunc method.
For more information, see “Working with User-Defined Functions” on
page 109 and “Registering a Function” on page 118.
Value Column
The argument values for the selected operation. The Value cell is partitioned
according to the number of arguments of the selected option in the
Operation column. The value can be a constant, a local parameter, or a
component parameter depending on the selected option.
Local parameter—A local parameter is specific to the business component
and can only be accessed by that component. It is intended for use in a
single step or between component steps, for example, as an output
parameter for one step and an input parameter for a later step. For more
information, see “Working with Parameters” on page 73.
Component parameter—A component parameter is a parameter that can be
accessed by any component in your Quality Center project. For more
information, see “Defining Parameters for Your Component” on page 103.
18
Chapter 2 • Getting Started with Business Components in QuickTest Professional
Output Column
The parameter in which output values for the step are stored, for example,
cCols would store the output value of the current step in a parameter called
cCols. You can then use the value stored in the output parameter later in the
component as an input parameter. As in the Value column, you can use two
types of parameters when specifying an output parameter—a local
parameter or a component parameter.
Documentation Column
Read-only auto-documentation of what the step does in an
easy-to-understand sentence. If you want to print or view only the steps,
you can choose to display only this column. For example, you may want to
print or view manual testing instructions.
Setting Keyword View Display Options
You can specify which columns you want to display and the order in which
they are displayed. For more information about the available columns, see
“Understanding the Business Component Keyword View Columns” on
page 17.
Tip: You can choose to display only the Documentation column and then
print the Keyword View for use as instructions for manual testing. For more
information on printing from the Keyword View, refer to the QuickTest
Professional User’s Guide.
19
Chapter 2 • Getting Started with Business Components in QuickTest Professional
To set the Keyword View display options:
1 Choose Tools > Keyword View Options or right-click a column header and
choose View Options. The Keyword View Options dialog box opens:
The Available columns box lists columns not currently displayed in the
Keyword View. The Visible columns box lists columns currently displayed in
the Keyword View.
2 Double-click column names or choose column names and click the arrow
buttons (> and <) to move them between the Available columns and Visible
columns boxes.
Tip: Click the double arrow buttons (>> and <<) to move all the column
names from one list to the other. Select multiple column names (using the
SHIFT and/or CONTROL keys) and click the arrow buttons (> and <) to move
only the selected column names from one list to the other.
3 In the Visible columns box, set the order in which columns appear in the
Keyword View by selecting one or more columns and then using the up and
down arrow buttons.
20
Chapter 2 • Getting Started with Business Components in QuickTest Professional
Note: The order of the columns in the Keyword View does not affect the
order in which the cells need to be completed for each step. For example, if
you choose to display the Operation column to the left of the Item column,
you still need to select the item first, and only then is the Operation column
list refreshed to match the selection you made in the Item column.
4 Click OK to close the dialog box and apply the new column display.
To display or hide specific columns:
Right-click the column header row and then select or clear the required
column name from the displayed menu.
Tip: You can quickly display only the Documentation column, for example,
if you want to print the steps for use as instructions for manual testing, by
selecting Documentation Only. The Documentation column and any
comments defined in the component are displayed.
To rearrange columns:
Drag a column header and drop it at a new location. Red arrows are
displayed when the column header is dragged to an available location.
21
Chapter 2 • Getting Started with Business Components in QuickTest Professional
Using QuickTest Commands for Business Components
QuickTest displays a different set of commands and toolbar buttons for tests,
business components, and application areas. Each set is customized for the
type of document you are creating or modifying.
You work with business components and application areas using the
Keyword View, described on page 16. You can select QuickTest commands
from the menu bar or from a toolbar. Some QuickTest commands can also
be executed by selecting commands from context-sensitive (right-click)
menus or pressing shortcut keys. For more information, see “Using
Keyboard Commands in the Business Component Keyword View” on
page 24.
All commands are available from the menu bar. You can execute frequently
used QuickTest commands by clicking buttons on the toolbars. For business
components and application areas, QuickTest has three built-in toolbars—
the File toolbar, the Testing toolbar, and the Debug toolbar. A brief
description of each toolbar is provided below. For more information, refer to
the QuickTest Professional User’s Guide.
File Toolbar
The File toolbar contains buttons for managing a component. The following
buttons are displayed on the File toolbar:
Open
New
22
Save
Print
Results
Options
Object Repository
Object Spy
Settings
Debug Viewer
Quality Center
Connection
Chapter 2 • Getting Started with Business Components in QuickTest Professional
Testing Toolbar
The Testing toolbar contains buttons for the commands used when creating
and maintaining your component. The following buttons are displayed on
the Testing toolbar:
Record
Stop
Start Run
Debug Toolbar
The Debug toolbar contains buttons for the commands used when
debugging the steps in your component. The following buttons are
displayed on the Debug toolbar:
Step
Into
Pause
Step
(Not in Use) Over
Step
Out
Clear All
Breakpoints
Insert/Remove
Breakpoint
23
Chapter 2 • Getting Started with Business Components in QuickTest Professional
Using Keyboard Commands in the Business Component
Keyword View
If you prefer to use your keyboard, you can use the following keyboard
commands to navigate within the Keyword View:
➤ Press F8 or INSERT/INS to add a new step below the currently selected step.
➤ The TAB and SHIFT+TAB keys move the focus left or right within a single row,
unless you are in a cell that is in edit mode. If so, press ENTER to exit edit
mode, and then you can use the TAB keys.
➤ When a cell containing a list is selected:
➤ You can press ENTER or SHIFT+F4 to open the list for that column.
➤ You can change the selected item by using the up and down arrow keys.
The list must be open before you can use the arrow keys.
➤ You can type a letter or sequence of letters to move to a value that starts
with the typed letter(s). The typed sequence is highlighted white.
➤ You can use the left and right arrow keys to move the focus one cell to the
left or right, with the following exceptions:
➤ In the last cell in a row, the right arrow key moves the focus to the first
cell in the next row.
➤ When a cell is in edit mode, for example, when modifying a value or
comment, the left and right arrow keys move within the edited cell.
➤ When a Value cell is selected, press CTRL+F11 to open the Value
Configuration Options dialog box.
➤ When an Output cell is selected:
➤ Press CTRL+F11 to open the Output Options dialog box.
➤ Press DELETE to cancel output to the parameter.
24
3
Working with Application Areas
Application areas provide all of the resources and settings needed to create a
business component. Each business component is based on an application
area from which it inherits these resources and settings.
Note: In earlier QuickTest Professional versions, the application area was
known as a business component template. At that time, all business
components used the same template. Now, QuickTest enables you to create
multiple application areas that can be customized to suit the requirements
of each area of your application.
This chapter describes:
➤ About Working with Application Areas
➤ Creating an Application Area
➤ Managing the Shared Object Repository
➤ Saving an Application Area
➤ Opening an Application Area
➤ Deleting an Application Area
25
Chapter 3 • Working with Application Areas
About Working with Application Areas
A Subject Matter Expert can implement the content of component steps
only after choosing the application area on which to base the component.
You create these application areas, which contain all of the resources and
settings required to create business components. When you create an
application area, you specify the general application area properties,
associations to any QuickTest Professional add-ins, add links to function
library files and to the shared object repository to be used by any
components, specify the Windows-based applications on which the
component can record and run, and add links to any recovery scenarios and
their settings.
You can create as many application areas as needed. For example, you may
decide to create an application area for each Web page, module, window, or
dialog box in your application. Alternatively, for a small application, one
application area may be all that is needed.
Before you create an application area, consider the requirements of Subject
Matter Experts that will use the application area to create business
components. What test objects will they need? How will you rename the
test objects and other items so that their meanings are clear to a wide range
of users? What user-defined functions can you add to ensure that all
required operations are available? To ensure availability, it is recommended
that these function library files be saved in the Quality Center project before
creating the application area, although you can update an application area
at any time. QuickTest also provides you with a set of pre-defined resource
files that you can associate with the application area, for example, a
function library file. These files are located in the Test Plan module of your
Quality Center project under Subject/BPT Resources.
When you save the application area, make sure that you provide it with a
meaningful name and a clear description. When a Subject Matter Expert
creates a new business component, the name and description provide the
only indication of the intended use of the application area. For example, if
an application area is intended for components that test a login dialog box,
you might name it “LoginDialog”.
26
Chapter 3 • Working with Application Areas
After you create an application area, you can notify the Subject Matter
Experts so that they can begin using it to create business components. (If
necessary, Subject Matter Experts can also start to create a component before
the application area is ready, and only later associate the application area
with the component.)
When the Subject Matter Expert creates a business component, a copy of the
settings and resources that you defined in the application area are
embedded in the component. Therefore, any changes that you make to the
application area at a later time are not applied directly to the component.
(The exception to this, of course, is the modification of linked resources
within Quality Center. As long as the path remains the same, the business
component will continue to access the linked file or shared object
repository. However, your test, component, or business process test may not
run correctly if you make changes to the content of a linked file.)
To apply changes from the application area, you need to notify the Subject
Matter Experts and ask them to update their copies of the application area.
For example, if you add a new function library reference to an application
area on which a business component is based, the business component will
have access to it only after its copy of the application area is updated.
Note that updating an application area may affect the business component
and prevent it from running correctly, for example, if a component step is
looking for a file that no longer exists. Therefore, it is recommended to
finalize the application area before making it available to Subject Matter
Experts (though not mandatory). For more information on updating an
application area, refer to the Business Process Testing User’s Guide.
Creating an application area comprises the following steps:
➤ Creating User-defined Functions in Function Library Files, see page 109
➤ Creating an Application Area, see page 28
➤ Managing the Shared Object Repository, see page 30
➤ Saving an Application Area, see page 35
27
Chapter 3 • Working with Application Areas
Creating an Application Area
When you create a new application area, you create a shell that will
ultimately contain all of the application area settings and resources needed
to create a new business component.
To create an application area:
1 In QuickTest, connect to the Quality Center project in which you want to
save the application area. This is the Quality Center project that will be used
by Subject Matter Experts to define business components and business
process tests. For more information, see “Connecting to Your Quality Center
Project” on page 12.
2 Choose File > New > Application Area or press CTRL + ALT + N. The
Application Area Settings dialog box opens.
28
Chapter 3 • Working with Application Areas
Tip: If an application area is already open, you can also click the New
toolbar button to open a new application area.
The Application Area Settings dialog box enables you to specify the settings
and resource files that you want business components based on the
application area to inherit and use.
3 You can now:
➤ Modify the application area settings and define its resources. The tabs in
the Application Area Settings dialog box are similar to the tabs in the
Business Components Settings dialog box. For more information about
the Settings tabs, see “Defining Business Component and Application
Area Settings” on page 85.
➤ Save the application area. (You can modify its settings later. However, it is
recommended to select a unique shared object repository for the
application area before you save it.) For more information, see “Saving an
Application Area” on page 35.
Note: If you close the Application Area Settings dialog box before you select
a shared object repository in the Resources tab, a message box opens asking
you to select a shared object repository for the application area. It is strongly
recommended that you use a different shared object repository for each
application area (and not use the default shared object repository provided
with QuickTest).
Tip: You can reopen the Application Area Settings dialog box at any time by
choosing Application Area > Settings or by clicking the Application Area
Settings toolbar button.
29
Chapter 3 • Working with Application Areas
Managing the Shared Object Repository
A shared object repository stores all of the test objects that may be used
when creating steps for a business component. After you associate a shared
object repository with an application area, it can be accessed by any
business component that is based on that application area. You can add test
objects to this shared object repository either by recording your application
or by adding test objects manually using the Object Repository dialog box.
For information on managing test objects in a shared object repository, refer
to the QuickTest Professional User’s Guide.
Note: Although QuickTest provides a shared object repository (stored in the
Test Plan module of your Quality Center project), it is strongly
recommended not to use it. If you associate this default shared object
repository (Default.tsr) with your application area or a specific component,
any components using this shared object repository may not run correctly.
You can use an existing shared object repository that already contains your
test objects, or you can create a new one. All business components based on
an application area that refers to this customized shared object repository
will then access this shared object repository file. For more information, see
“Adding a Shared Object Repository to Your Quality Center Project” on
page 31.
After you add test objects to the shared object repository, they are displayed
in the Item list in the Keyword View (according to relevance) and in the
Select Object for Step dialog box. Both you and Subject Matter Experts can
then use the test objects to add steps to business components. For more
information, see “Selecting an Item for Your Step” on page 62.
It is recommended to rename test objects with meaningful names that will
enable Subject Matter Experts to easily identify the test object they need to
use for a specific step. For example, if a test object is called Edit, by default,
you may want rename it to UserName (if that is what the user needs to enter
in the edit box, of course).
30
Chapter 3 • Working with Application Areas
For container objects, it is recommended to specify their context, for
example, if you have several confirmation message boxes, you may want to
name one Login > Confirm, another ChangePassword > Confirm, and still
another BillingInfo > Confirm. For more information, see “Modifying Test
Object Names” on page 34.
Note: You cannot add WinMenu objects directly to the shared object
repository using the Add Objects button in the Object Repository dialog
box. If you want to add a WinMenu object to the repository, you can record
it and then delete the recorded step from the Keyword View.
Adding a Shared Object Repository to Your Quality Center
Project
To enable a Subject Matter Expert to access the test objects from the
application when implementing component steps, the test objects must be
stored in a shared object repository located in your Quality Center project.
You can add as many shared object repositories to your Quality Center
project, as needed. After you add a shared object repository to your project,
you can choose it, as described in “Specifying a Different Shared Object
Repository for the Application Area” on page 33.
Note: It is recommended to use a unique shared object repository for each
application area.
31
Chapter 3 • Working with Application Areas
To create a shared object repository in your Quality Center project:
1 In QuickTest, open the Application Area Settings dialog box, (if it is not
open) by choosing Application Settings > Settings or by clicking the
Application Area Settings toolbar button.
2 In the Resources tab, enter a path and name for the new shared object
repository in the Object repository location box. The path must be to your
Quality Center project, for example:
[Quality Center] Subject\BPT Resources\Object Repositories\MyRepository.tsr
Tip: You can click the Object repository location browse button, choose an
existing shared object repository file, and add it to your application area.
This provides you with the correct path. Then, rename the file in the Object
repository location box. For example, if you chose Default.tsr, you can now
rename it to MyRepository.tsr. For information on choosing an existing
shared object repository, see “Specifying a Different Shared Object
Repository for the Application Area” on page 33.
3 Click Apply to create a new shared object repository file and keep the
Application Area Settings dialog box open, or click OK to create a new
shared object repository file and close the Application Area Settings dialog
box. QuickTest asks you if you want to create a new shared object repository
file.
4 Click Yes. You can now add test objects to your shared object repository. For
more information, refer to the QuickTest Professional User’s Guide.
32
Chapter 3 • Working with Application Areas
Specifying a Different Shared Object Repository for the
Application Area
If you added another shared object repository file to your Quality Center
project, you can specify it in the application area. This enables all business
components that are based on the application area to access the test objects
that are stored in this file.
To specify a different shared object repository for the application area:
1 In QuickTest, open the Application Area Settings dialog box, (if it is not
open) by choosing Application Settings > Settings or by clicking the
Application Area Settings toolbar button.
2 Select the Resources tab and click the Object repository location browse
button. The Open Shared Object Repository dialog box opens.
3 In the Attachments pane, select the object repository file that you want to
associate with your application area. The name is displayed in the
Attachment Name box.
33
Chapter 3 • Working with Application Areas
4 Click OK. The Open Shared Object Repository dialog box closes and the
selected file is displayed in the Object repository location box in the
Resources tab.
All business components that are based on the application area from this
point on will have access to the test objects stored in this shared object
repository. If you want components that are already based on this
application area to access this new shared object repository, you need to ask
the Subject Matter Experts to update their copies of the application area. For
more information on updating application areas, refer to the Business Process
Testing User’s Guide.
Modifying Test Object Names
Subject Matter Experts need to be able to distinguish between the various
test objects when they define steps for a business component. Therefore, it is
important that all test object names be self-explanatory. You can change the
name that QuickTest assigns automatically to a stored test object. When you
modify the name of an object, the name is automatically updated in the
QuickTest Keyword View and the Steps tab of the Quality Center Business
Components module for all occurrences of the object (also in steps that
were created using the old test object names).
When you open another component that uses the same shared object
repository and has one or more occurrences of the modified object, the
names within that component are updated. This may take a few moments.
34
Chapter 3 • Working with Application Areas
To modify a test object’s name:
1 Open the shared object repository. Choose Tools > Object Repository, click
the Object Repository toolbar button, or open the Object Properties dialog
box for the object you want to modify and click the Repository button.
2 Right-click the object in the object repository tree and choose Rename.
3 Modify the name of the object and click OK or select another object in the
object repository tree. The name you assign to the object must be unique
within the specific hierarchy of the shared object repository. Object names
are not case-sensitive.
Saving an Application Area
You can save an application area before or after you define its settings and
resources. However, before you save an application area, it is strongly
recommended to select a unique shared object repository for it (not the
default shared object repository provided with QuickTest).
When you save an application area, make sure that you provide a unique
name and description that clearly indicate its use. For example, if the
application area is intended to be used by components that test the Log In
module, you might name it “Log In” and add a description that specifies its
intended use, such as, “Intended for use with business components that test the
Log In module.”
35
Chapter 3 • Working with Application Areas
To save an application area:
1 In QuickTest, connect to a Quality Center server and project with Business
Process Testing support. For more information, see “Connecting to Your
Quality Center Project” on page 12.
2 Create an application area. You can add information to it or leave it blank
and modify it later. For more information, see “Creating an Application
Area” on page 28.
3 Click Save or choose File > Save. The Save Application Area dialog box
opens.
36
Chapter 3 • Working with Application Areas
The Save Application Area dialog box includes the following items:
Option
Description
Existing
Application Areas
Lists all defined application areas. This enables you to see
the names of the existing application areas so that you can
specify a unique name for the application area that you
want to save.
Name
Indicates the name of the application area. Enter a
descriptive name that will enable Subject Matter Experts to
quickly identify the application area that is suitable for
their component.
Note: The name you enter must not exceed 255 characters.
Description
Displays the description you entered in the Properties tab of
the Application Area Settings dialog box when you created
the application area. For more information, see “Creating
an Application Area” on page 28.
If you did not enter a description when you created the
application area, you must enter one now. The mandatory
description you provide will enable Subject Matter Experts
to easily differentiate between the various application areas
and choose the one that is best suited for their component.
4 Click OK to save the application area.
Tip: If you are creating a new application area that is similar to an existing
one, you can use the Save As option. Then you can modify the application
area, as needed.
37
Chapter 3 • Working with Application Areas
Opening an Application Area
After an application area is saved, you can open it for viewing or
modification. For example, you may want to update a recovery scenario or
add a library file with user-defined functions to the application area.
To open an application area:
1 In QuickTest, connect to a Quality Center server and project with Business
Process Testing support. For more information, see “Connecting to Your
Quality Center Project” on page 12.
2 Choose File > Open > Application Area or press CTRL + ALT + O. If another
application area is already open, you can also click Open.
The Open Application Area dialog box opens and displays a list of the
defined application areas. You can click on an application area to view its
description. (These are the descriptions that Subject Matter Experts use to
determine which application area to choose when they create a new
business component.)
3 Select an application area and click OK. The selected application area opens.
38
Chapter 3 • Working with Application Areas
4 You can:
➤ View the settings for the application area.
➤ Modify the settings for the application area. For more information, see
“Defining Business Component and Application Area Settings” on
page 85.
Note: You can also delete an application area from this dialog box. For more
information, see “Deleting an Application Area”, below.
Deleting an Application Area
If an application area is no longer needed, you can delete it. Deleting an
application area does not affect business components that currently use it
because each business component saves a copy of the associated settings
and resource links locally. A business component does not need to access to
the application area on which it is based to run correctly.
Tip: If you delete an application area and later need to modify it, you can
recreate the application area using the same name as the deleted one.
Subject Matter Experts can then update the application area from the
Business Components module in Quality Center. For more information on
updating application areas, refer to the Business Process Testing User’s Guide.
39
Chapter 3 • Working with Application Areas
To delete an application area:
1 In QuickTest, connect to the Quality Center project that contains the
application area that you want to delete. For more information, see
“Connecting to Your Quality Center Project” on page 12.
2 Choose File > Open > Application Area or press CTRL + ALT + O. If another
application area is already open, you can also click Open. The Open
Application Area dialog box opens.
3 Select the application area that you want to delete and click the Delete
button. A warning message displays.
Note: You cannot delete the currently open application area or an
application area that is currently being used by another QuickTest Engineer.
4 Click Yes to confirm. The selected application area is deleted.
40
4
Working with Business Components
You can use the Business Component Keyword View to create, view, modify,
and debug a business component in QuickTest.
This chapter describes:
➤ About Working with Business Components
➤ Creating a New Business Component
➤ Saving a Business Component
➤ Opening an Existing Business Component
About Working with Business Components
Generally, business components are created and modified in Quality Center
by Subject Matter Experts. For more information, refer to the Business Process
Testing User’s Guide. However, you can use the Business Component
Keyword View to create, view, modify, and debug a business component in
QuickTest, if required.
In the Keyword View, business components are divided into steps in a
modular, keyword-driven, table format. Each step is a row that comprises
individual parts that you can easily modify. You create and modify steps by
selecting items and operations and entering additional information, as
required.
41
Chapter 4 • Working with Business Components
Each step in a business component is automatically documented as you
complete it. This enables you to view a description of the step in
understandable sentences. If you have already created an application area
and added a function library file to it, when you define a step by selecting a
user-defined operation (function), the documentation that you added in the
function library file will be displayed for the step. For more information, see
“Documenting the Function” on page 121.
Before you create or open a business component, you connect QuickTest to
a Quality Center project, which is where business components and
application area resources and settings are stored. Connecting to your
Quality Center project enables QuickTest to create or open the business
component. This also enables the business component to access all of the
resources defined in the application area on which the component is based.
If the application area you select does not yet contain all of the required
resources and settings, you can still add steps using the Comment option.
This enables you to type in manual steps as you would in another
application, such as Microsoft Excel or Microsoft Word. You can also use this
option to add information about a step or to separate sections of your
business component. Each comment appears as a separate row in the
Keyword View. For more information, see “Working with Comments” on
page 81.
Note: If you want to delete a component, whether it was created in
QuickTest or in Quality Center, it can be deleted only in Quality Center. For
more information, refer to the Business Process Testing User’s Guide.
42
Chapter 4 • Working with Business Components
Creating a New Business Component
When QuickTest is connected to a Quality Center project, you can create a
new business component in that project.
Each business component is based on a specific application area, which is
stored in the Quality Center project in which you intend to save the
component. Each application area specifies the settings and resources for
the business component, including the location of the shared object
repository, function library files, recovery scenarios, and other information.
There may be one or more application areas from which to choose. You
select the application area that is best suited for your business component.
For more information, see “Working with Application Areas” on page 25.
Generally, business components are created in Quality Center by Subject
Matter Experts. For more information, refer to the Business Process Testing
User’s Guide. However, if needed you can also create business components in
QuickTest. This section describes how to create a new component in
QuickTest.
To create a new business component:
1 Connect to the Quality Center project in which you want to save the
business component. For more information, see “Connecting to Your
Quality Center Project,” on page 12.
43
Chapter 4 • Working with Business Components
2 Choose File > New > Business Component or press CTRL + SHIFT + N. The
New Business Component dialog box opens, listing all available application
areas. You can click on an application area to view its description. (These are
the descriptions that Subject Matter Experts use to determine which
application area to choose when they create a new business component.)
Note: If you have not yet defined an application area, a new, untitled
business component opens using the default settings that are supplied with
Business Process Testing. Later, after you define an application area, you can
base the business component on it.
Tip: If a business component is already open, you can also click the New
toolbar button to open a new component.
3 Select a suitable application area from the Application Area box. For
example, if you want to create a business component for a Log In module,
select the application area that is defined for it. Click OK.
44
Chapter 4 • Working with Business Components
A new, untitled business component opens in the Keyword View. Although
the business component does not yet contain content, it does contain all of
the required settings and resources that were defined in the application area
on which it is based. If the application area contained steps, these steps are
also added to the new business component.
Note: If the selected application area is associated with a shared object
repository that is locked, a message regarding locked resources opens when
you create a new component based on this application area. For more
information, refer to the QuickTest Professional User’s Guide.
4 You can now:
➤ Add steps and comments to your business component. For more
information, see “Adding a Step to Your Component” on page 59 and
“Working with Comments” on page 81.
➤ Save your component. (You can add steps later.) For more information,
see “Saving a Business Component” on page 46.
45
Chapter 4 • Working with Business Components
Saving a Business Component
After you create or modify a component, you can save it to your Quality
Center project. When you save a component, you give it a descriptive name
and save it to the relevant folder in the component tree in the Quality
Center project (Business Components module).
You can also save a copy of an existing component to any folder in the same
Quality Center project. To enable all users to differentiate between the
various components, you may want to rename a copy of a component, even
if you save it to a different folder.
You save business components and scripted components in the same way.
For more information on scripted components, see “Working with Scripted
Components” on page 51.
Note: For scripted components only, the data sheet name in the Data Table
is identical to the scripted component name. If you save a scripted
component with a new name (File > Save As), the data sheet is automatically
renamed. If you have a step that references the data sheet by name, the step
will fail during the run session because it references the former data sheet
name. If you save a scripted component with a new name, you must find
any references to the former data sheet name in the Expert View and replace
them with the new data sheet name.
To save a component to your Quality Center project:
1 Save the component in one of the following ways:
➤ For a new component that has never been saved, click Save, choose File >
Save, or press CTRL + S.
➤ To save a copy of an existing component, choose File > Save as.
46
Chapter 4 • Working with Business Components
The Save Business Component dialog box opens and displays the
component tree.
In the component tree, the status of each component is indicated by its
icon. For more information, refer to the Business Process Testing User’s Guide.
2 Select the folder in which you want to save the component. To expand the
tree and view a sublevel, double-click a closed folder. To collapse a sublevel,
double-click an open folder.
You can either save the component to an existing folder in your Quality
Center project or click the New Folder button to create a new folder in
which to save it. If you want to save a copy of an existing component with
same name, you must save it to a different folder.
3 In the Component Name box, enter a name for the component. Use a
descriptive name that will help you and others identify the component
easily. You cannot use the following characters in a component name:
\/:"?<>|*%'
4 Accept the default Component Type—QuickTest Component.
47
Chapter 4 • Working with Business Components
5 Click OK to save the component and close the dialog box. As QuickTest
saves the component, the operations that it performs are displayed in the
status bar.
The component is saved to the Quality Center project. You can now view
and modify it using QuickTest.
Note: Subject Matter Experts can also access the component from the
Quality Center Business Components module. For more information, refer
to the Business Process Testing User’s Guide.
Tip: If the component was saved previously, you can save it by clicking
Save, choosing File > Save, or pressing CTRL + S.
Opening an Existing Business Component
When QuickTest is connected to a Quality Center project, you can open a
component that is stored in the project to view, modify, debug, or run it.
You find components according to their location in the component tree.
You save business components and scripted components in the same way.
For more information on scripted components, see “Working with Scripted
Components” on page 51.
Note: Components that are currently open in Quality Center or another
QuickTest session are locked and can be opened only in read-only format.
To work with these components, they must be closed elsewhere.
48
Chapter 4 • Working with Business Components
To open an existing component:
1 In QuickTest, connect to the Quality Center project in which your
component is saved. For information on connecting to Quality Center, see
“Connecting to Your Quality Center Project” on page 12.
2 Choose File > Open > Business Component. The Open Business Component
dialog box opens showing all of the components stored in the Quality
Center project.
In the component tree, the status of each component is indicated by its
icon. For more information, refer to the Business Process Testing User’s Guide.
Tip: You can open a recently used component by selecting it from the
Recent Files list in the File menu. If you select a component when you are
not connected to the Quality Center project, or if you select a component
that is stored in a different Quality Center project, QuickTest displays a
message asking you if you want to connect to that project.
If a component is already open, you can also click the Open toolbar button
to open another component.
49
Chapter 4 • Working with Business Components
3 Click the relevant folder in the component tree. To expand the tree and
view the business components, double-click closed folders. To collapse the
tree, double-click open folders.
4 Select a component. The component name is displayed in the read-only
Component Name box.
5 Click OK to open the component.
As QuickTest downloads and opens the component, the operations it
performs are displayed in the status bar.
When the component opens, the QuickTest title bar displays Components,
the full path and the component name. For example, the title bar for a
flight_login component may be:
Components\Flight\flight_login
Note: If the component you are opening is associated with a shared object
repository that is locked, a message opens instructing you how to open the
component. For more information on locked resources, refer to the
QuickTest Professional User’s Guide.
50
5
Working with Scripted Components
Scripted components are easily-maintained reusable scripts that perform a
specific task. Scripted components are similar to the business components
provided in QuickTest Professional version 8.0.
You can use the Keyword View, the Expert View, and other QuickTest tools
and options to create, view, modify, and debug scripted components in
QuickTest.
This chapter describes:
➤ About Working with Scripted Components
➤ Creating a Scripted Component
51
Chapter 5 • Working with Scripted Components
About Working with Scripted Components
You can utilize the full power of both the Keyword View and the Expert
View, as well as other QuickTest tools and options, when working with
scripted components. For example, you can use the Step Generator to guide
you through the process of adding methods and functions to your scripted
component. Using the Expert View, you can enhance the scripted
component flow by manually entering standard VBScript statements and
other programming statements using QuickTest test objects and methods.
You can also incorporate user-defined functions in your scripted component
steps, parameterize selected items, and add checkpoints and output values
to your scripted component. This chapter only describes how to create
scripted components. For information about all of the functionality
available for scripted components, refer to the QuickTest Professional User’s
Guide.
You can create scripted components for Subject Matter Experts, for example,
if they need components that contain more complex functionality, such as
loops or conditional statements. Subject Matter Experts working in Quality
Center can then include these scripted components in business process tests
to check that the application behaves as expected.
After you create a scripted component, Subject Matter Experts can view the
auto-documentation generated by the component (read-only) in the
Business Components module of the Quality Center project. They can run
the scripted component and add it to their business process tests, but you
remain responsible for maintaining the scripted component in QuickTest, if
any changes are needed. Scripted components cannot be modified in
Quality Center.
You save and open scripted component in the same way as you save and
open business components. For more information, see “Saving a Business
Component” on page 46 and “Opening an Existing Business Component”
on page 48.
52
Chapter 5 • Working with Scripted Components
Creating a Scripted Component
When QuickTest is connected to a Quality Center project, you can create a
new scripted component in that project.
Each scripted component is based on a specific application area, which
contains the resources and settings used by the component, such as the
location of the shared object repository and function library files. You select
the application area that is best suited for your scripted component. You can
choose from any application area that is located in the Quality Center
project in which you intend to save the component. For more information,
see “Working with Application Areas” on page 25.
Notes:
If you have not yet created an application area, the scripted component will
be based on the default settings provided with Business Process Testing, and
you will not be able to select an application area for it.
After you select an application area for a scripted component, you cannot
change the application area on which it is based.
53
Chapter 5 • Working with Scripted Components
To create a scripted component:
1 Connect to the Quality Center project in which you want to save the
scripted component. For more information, see “Connecting to Your
Quality Center Project,” on page 12.
2 Choose File > New > Scripted Component or press ALT + SHIFT + N. The New
Business Component dialog box opens, listing all available application
areas.
Note: If you have not yet created an application area, a new, untitled
scripted component opens using the default settings that are supplied with
Business Process Testing. You will not be able to change the application area
later.
Tip: If a scripted component is already open, you can also click the New
toolbar button to open a new scripted component.
54
Chapter 5 • Working with Scripted Components
3 Select a suitable application area from the Application Area box. For
example, if you want to create a scripted component for a Flight Reservation
module, select the application area that is defined for it. Click OK.
A new, untitled scripted component opens. Although the scripted
component does not yet contain content, it does contain all of the required
settings and resources that were defined in the application area on which it
is based.
Note: If the selected application area is associated with a shared object
repository that is locked, a message regarding locked resources opens when
you create a new component based on this application area. For more
information, refer to the QuickTest Professional User’s Guide.
55
Chapter 5 • Working with Scripted Components
4 You can now:
➤ Add content to your scripted component using the functionality and
options provided by QuickTest. For example, in the Expert View, you can
manually enter standard VBScript statements, as well as add statements
using QuickTest objects and methods. You can use the Step Generator to
add steps containing programming logic. You can also add checkpoints
and output values to your scripted component. For more information
about the functionality that can be used when creating a scripted
component, refer to the QuickTest Professional User’s Guide.
➤ Save your scripted component. (You can add content later.) You save a
scripted component in the same way as you save a business component.
For more information, see “Saving a Business Component” on page 46.
Note: Subject Matter Experts can view (read-only) and work with scripted
components from the Quality Center Business Components module. They
cannot modify scripted component steps. For more information, refer to the
Business Process Testing User’s Guide.
56
6
Working with the Business Component
Keyword View
The Business Component Keyword View provides an easy way to create,
view, modify, and debug business component steps in a graphical
easy-to-use format.
This chapter describes:
➤ About Working with the Business Component Keyword View
➤ Adding a Step to Your Component
➤ Selecting an Item for Your Step
➤ Selecting the Operation for Your Step
➤ Defining Values for Your Step Arguments
➤ Defining an Output Value for Your Step
➤ Working with Parameters
➤ Working with Comments
➤ Managing Component Steps
57
Chapter 6 • Working with the Business Component Keyword View
About Working with the Business Component Keyword
View
In general, the Subject Matter Expert uses the Steps tab in the Quality Center
Business Components module to add content to and modify component
steps. However, this can also be done in QuickTest, as described in this
chapter.
You use the Business Component Keyword View to create, view, modify, and
debug business component steps and application areas.
The Business Component Keyword View differs from the QuickTest Test
Keyword View in that it provides component-specific options that are
specially designed to facilitate the creation of business components. This
makes it easy and intuitive for Subject Matter Experts to create business
components in Quality Center. (The Business Component Keyword View
that you see in QuickTest is the same as the Steps tab that the Subject Matter
Expert uses in Quality Center.)
The Business Component Keyword View can include comments, which
enable you to enter manual steps and informational separators in a business
component. All items (test objects and operations) in the Keyword View are
displayed at the same hierarchical level, even if they are child objects of the
previous step or operations to be performed. This makes it easier for Subject
Matter Experts to manage their business component steps.
To work with the Business Component Keyword View, QuickTest must be
connected to a Quality Center project with Business Process Testing support.
58
Chapter 6 • Working with the Business Component Keyword View
Adding a Step to Your Component
After you create a new business component, the Keyword View is empty, as
shown below (unless the associated application area contains steps).
When you add steps to it, each step is defined as a single row in the Keyword
View. You can add a step below the currently selected step, at the end of an
existing component, or at the beginning of a new component. You can also
enter a comment.
Steps—A step represents an operation to be performed. After you create a
step, you specify its contents. For example, you can choose the test object
on which the step is performed, specify the operation to be performed in the
step, and specify any relevant input or output values. When a business
process test is run in Quality Center, the steps defined in the associated
business components are performed. This section describes how to add a
step to your business component.
Comments—A comment is a free text entry that spans an entire row.
The
icon indicates a comment. You use comments to define manual
steps or to provide information about adjacent steps in your business
component. Comments are not processed when a business process test is
run. For more information, see “Working with Comments” on page 81.
To add a step:
1 Select the row after which you want to add the new step and choose
Insert > New Step, or press F8 or INSERT, or right-click a step and choose
New Step from the context-sensitive menu. A new step is added to the
Keyword View below the selected step.
59
Chapter 6 • Working with the Business Component Keyword View
Tip: If no steps are currently defined for your component, you can click
anywhere in the Keyword View to add a new step. If you want to add a step
at the end of your component, you can click anywhere in the Keyword View
grid below the existing steps to add a new step.
2 Define the step by clicking in the cell for the part of the step you want to
modify and specifying its contents, as described below. Each cell in the step
row represents a different part of the step. For each step, you can define the
following:
➤ Item—Either a test object on which you perform a step, or a user-defined
function (Operation). You must select an option from the Item column
before you can add additional content to a step. For more information,
see “Selecting an Item for Your Step” on page 62.
Alternatively, you can choose to add a Comment, which enables you to
add a manual step or other free text information between steps. For more
information, see “Working with Comments” on page 81.
➤ Operation—The operation to be performed on the item. For more
information, see “Selecting the Operation for Your Step” on page 67.
➤ Value (if relevant)—The argument values for the selected operation. For
more information, see “Defining Values for Your Step Arguments” on
page 69.
➤ Output (if relevant)—The parameter in which output values for the step
are stored. For more information, see “Defining an Output Value for Your
Step” on page 70.
60
Chapter 6 • Working with the Business Component Keyword View
Note: The Documentation cell is read-only. This cell displays an explanation
of what the step does in an easy-to-understand sentence, for example, Click
the “Sign-in” image. or Select “San Francisco” in the “toPort” list. In most cases,
QuickTest can generate the description displayed in this cell.
If you created a function library and referenced it from the associated
application area (or from the business component directly) using the
Resources tab of the Application Area Settings dialog box (or the Business
Component Settings dialog box), QuickTest can only display
documentation for it if you defined the relevant text in the function library
file. For more information, see “Documenting the Function” on page 121.
Tip: You can use the standard editing commands (Cut, Copy, Paste and
Delete) in the Edit menu or in the context-sensitive menu to make it easier
to define or modify your steps. You can also drag and drop steps to move
them to a different location within your component. For more information,
see “Managing Component Steps” on page 83.
3 After you make your changes, save the component to your Quality Center
project. For more information, see “Saving a Business Component” on
page 46.
61
Chapter 6 • Working with the Business Component Keyword View
Selecting an Item for Your Step
An item can be a test object in the shared object repository or a user-defined
function—Operation. (The Operation item is available only if user-defined
functions were added to a function library that is associated either with the
application area or directly with the business component. For more
information, see “Working with User-Defined Functions” on page 109.)
This section describes:
➤ “Selecting a Test Object from the Item List” on page 63
➤ “Selecting a Test Object from the Shared Object Repository” on page 63
➤ “Selecting a Test Object from Your Application” on page 64
➤ “Selecting the Operation Item” on page 66
After you select an item, you specify an operation for it. For more
information, see “Selecting the Operation for Your Step” on page 67.
Note: In addition to selecting an item or Operation in the Item cell, you can
also select Comment. This instructs QuickTest to convert the selected step
into a free text cell that spans the entire row. After the step is converted into
a comment, it cannot be restored to a step. You use the Comment option to
enter manual steps or to provide information about adjacent steps. For more
information, see “Working with Comments”, on page 81.
62
Chapter 6 • Working with the Business Component Keyword View
Selecting a Test Object from the Item List
The test objects available in the Item list are the sibling and child test
objects of the previous step’s test object, as defined in the shared object
repository. The example below shows the objects available for the step
following a userName test object.
To select a test object from the displayed Item list:
1 Click in the Item cell, then click the arrow button to display the Item list. If
you have just created a new step, the list is displayed automatically as soon
as you create the new step.
2 In the Item list, select the test object on which you want to perform the
step. The item you select is displayed in the Item cell. You now need to
specify an operation for the step. For more information, see “Selecting the
Operation for Your Step” on page 67.
Selecting a Test Object from the Shared Object Repository
The shared object repository includes all of the test objects that are defined
in the application area on which your component is based (including those
displayed in the Item list, above). For more information on the shared
object repository, refer to the QuickTest Professional User’s Guide.
To select a test object from the shared object repository:
1 Click in the Item cell, then click the arrow button to display the Item list. If
you have just created a new step, the list is displayed automatically as soon
as you create the new step.
2 In the Item list, choose Select another object. The Select Object for Step
dialog box opens.
63
Chapter 6 • Working with the Business Component Keyword View
3 Select a test object from the shared object repository tree and click OK.
The selected test object is displayed in the Item cell and is also added to the
Item list. You now need to specify an operation for the step. For more
information, see “Selecting the Operation for Your Step” on page 67.
Selecting a Test Object from Your Application
If the shared object repository does not include the test object that you need
for this step, you can select it directly from your application and add it to
the shared object repository so that you can use it in this and other steps.
64
Chapter 6 • Working with the Business Component Keyword View
To add a test object from your application:
1 Click in the Item cell, then click the arrow button to display the Item list. If
you have just created a new step, the list is displayed automatically as soon
as you create the new step.
2 In the Item list, choose Select another object. The Select Object for Step
dialog box opens.
3 Click the pointing hand button. QuickTest is minimized.
4 Use the pointing hand to click on the required object in your application.
Tip: You can hold the CTRL key to change the window focus or perform
operations such as a right-click or mouseover to display a context menu. If
the window containing the object you want to click is partially hidden by
another window, you can also hold the pointing hand over the partially
hidden window for a few seconds until the window comes into the
foreground and you can point and click on the object you want. Note that
pressing the CTRL key does not enable you to select an application from the
Windows taskbar, therefore you must make sure that the window you want
to access is not minimized.
If the location you clicked is associated with more than one object, the
Object Selection dialog box opens.
65
Chapter 6 • Working with the Business Component Keyword View
5 Select the object for the new step and click OK. The object is displayed in the
shared object repository tree in the Select Object for Step dialog box.
6 Click OK. The object is displayed in the Item column in the Keyword View.
You can now specify the operation for the selected object. For more
information, see “Selecting the Operation for Your Step” on page 67.
Tip: If you select an object in your application that is not in the shared
object repository, a test object is added to the shared object repository when
you insert the new step. After you add a new test object to the shared object
repository, it is recommended to rename it, if its name does not clearly
indicate its use. For example, you may want to rename a test object named
Edit (that is used for entering a username) to UserName. This will enable
Subject Matter Experts to select the appropriate test object when adding
steps using test objects located in this shared object repository.
If you are adding a container test object, it is also recommended to specify
its context, for example, if you are adding a confirmation message box from
a Login page, you may want to name it Login > Confirm. For more
information, see “Modifying Test Object Names” on page 34.
Selecting the Operation Item
If your business component references a function library that contains at
least one user-defined function, or if it is based on an application area that
references a function library file, you can select the Operation item and
select a function for the step.
User-defined functions enable you to perform a variety of additional
operations, for example, open an application at the start of a business
component or check the value of a specific property.
Note: If your component or the application area on which it is based are not
associated with any function library files, the Operation option does not
appear in the Item list.
66
Chapter 6 • Working with the Business Component Keyword View
To select an Operation item:
1 Click in the Item cell, then click the arrow button to display the Item list. If
you have just entered a new step, the list is displayed automatically as soon
as you create the new step.
2 In the Item list, choose Operation. The Operation item is displayed in the
Item cell. You now need to specify an operation for the step. For more
information, see “Selecting the Operation for Your Step” on page 67.
Note: If the associated function library is no longer valid, for example, if the
user-defined function was removed from the function library or if another
function library is now associated with the component, an error message
displays and Operation is removed from the Item list. You can check which
function library files are not valid using the Resources tab of the Business
Component Settings dialog box. For more information, see “Defining
Resources for Your Component or Application Area” on page 101.
Selecting the Operation for Your Step
The Operation cell specifies the action to be performed on the item listed in
the Item column. The available operations vary according to the item
selected in the Item column. Only the most commonly used operations are
listed. For example, if you selected a browser test object, such as a
WebButton object, the list contains the most commonly used methods
available for the button object, such as Click. If you selected Operation in
the Item column, the list contains the user-defined function(s) defined in
the function library file(s) associated with the business component.
You specify function library files in the Resources tab of the Application Area
Settings dialog box when you create the application area. If you want to
associate a function library file with a specific business component, you can
add the file to the Resources tab in the Business Component Settings dialog
box. For more information, see “Defining Resources for Your Component or
Application Area” on page 101.
67
Chapter 6 • Working with the Business Component Keyword View
To select an operation for the step:
Click in the Operation cell, then click the arrow button and select the
operation to be performed on the item. The operation can be either a
standard operation or a user-defined function. For more information on
user-defined functions, see “Working with User-Defined Functions” on
page 109.
Note: When you position the cursor over an operation in the list, a tooltip
describes the action that this operation performs. For user-defined
functions, the tooltip is taken from the description that you provided in the
associated function library file. For more information, see “Documenting
the Function” on page 121.
If you selected a test object in the Item column, the default operation (most
commonly-used operation) for the test object item is automatically
displayed in the Operation column. The Operation list for that test object
includes out-of-the-box operations and any user-defined functions that were
registered to that specific test object type.
If you selected Operation in the Item column, QuickTest displays the
functions that you defined in the function library file, alphabetically. (You
manage the function library files for components in the Resources tab of the
Application Area Settings dialog box or the Business Component Settings
dialog box (if defined only for this component). For more information, see
“Defining Resources for Your Component or Application Area” on page 101.
68
Chapter 6 • Working with the Business Component Keyword View
Defining Values for Your Step Arguments
The Value cell lists the value(s) for the operation argument(s). You can insert
a constant value or a parameter. If you insert a parameter, it can be either a
local parameter or a component parameter. For more information, see
“Working with Parameters” on page 73 and “Defining Parameters for Your
Component” on page 103.
The Value cell is partitioned according to the number of possible arguments
of the selected operation. Each partition contains different options,
depending on the type of argument that can be entered in the partition, as
follows:
Argument
Partition
Argument Type
Instructions
String
Enables you to enter any alphanumeric string
enclosed by quotes. If you do not enter the
quotes, QuickTest adds them automatically. If
you modify a cell that contains a string enclosed
by quotes by removing the quotes, QuickTest
will not restore the quotes.
Integer
Enables you to enter any number, or use the up
and down arrows to select a number.
Boolean
Enables you to select a True or False value from
the drop-down list.
You can parameterize the value for an argument, using a local or component
parameter, by clicking the
button in the required Value cell. For
information on parameterizing a local value, see “Working with Parameters”
on page 73. For information on parameterizing a component value, see
“Defining Parameters for Your Component” on page 103.
69
Chapter 6 • Working with the Business Component Keyword View
To define or modify a value:
Click in each partition of the Value cell and enter the argument values for
the selected operation. Note that when you click in the Value cell, a tooltip
displays information for each argument. In the tooltip, the argument for the
partition that is currently highlighted is displayed in bold, and any optional
arguments are enclosed in square brackets.
Defining an Output Value for Your Step
You define the output type and settings for the output value in the Output
cell. These determine where the output value is stored and how it is used
during the component run session. When the output value step is reached,
QuickTest retrieves each value selected for output and stores it in the
specified location for use later in the run session.
When you create a new output value step, QuickTest assigns a default
definition to each value selected for output. When you output a value for a
step in a business component:
➤ if at least one output component parameter is defined in the component,
the default output type is Component parameter and the default output
name is the first output parameter displayed in the Parameters tab of the
Business Component Settings dialog box.
➤ if no output component parameter is defined in the component, the default
output type is Local parameter and the default name is p_Local.
You modify the output parameter, as required. If you select a local
parameter, you can modify it directly in the Output Options dialog box. If
you select a component parameter, the details for the output parameter are
read-only. You can modify the parameter details in the Parameters tab of the
Business Component Settings dialog box. For more information, see
“Defining Parameters for Your Component” on page 103.
If, after you specify an output value, you choose not to save the output
value, you can cancel it. For more information, see “Canceling Output to a
Parameter” on page 72.
70
Chapter 6 • Working with the Business Component Keyword View
To configure output to a parameter:
1 Click in the Output cell to create or edit an output to a parameter. Click the
Output button
or press CTRL + F11. The Output Options dialog box
opens.
2 In the Output Types box, select either Component parameter or Local
parameter. The Details area displays the options available for the selected
component type.
Note: The Component parameter type is available only if an output
component parameter is defined for the component. If you select a
component parameter, the information displayed is read-only. For more
information, see “Defining Parameters for Your Component” on page 103.
71
Chapter 6 • Working with the Business Component Keyword View
3 Select the required parameter from the Name box. If no local parameter is
defined, then p_Local is the default parameter name displayed.
➤ You can create a new local parameter, if needed. For more information,
see “Working with Parameters” on page 73.
➤ If you select a local parameter, specify the details for it. For more
information, see “Working with Parameters” on page 73.
➤ If you select a component parameter, its details are read-only.
4 Click OK. The Output cell displays the parameter to which the output value
will be saved.
Tip: If you click in the Output cell after you specify an output parameter for
it, an icon specifying the type of parameter is displayed in the cell:
Indicates a component parameter.
Indicates a local parameter.
Canceling Output to a Parameter
If you do not want to store the output value for a component step, you can
cancel it.
To cancel output to a parameter:
Click in the Output cell. Then click the Cancel button
cancel output to the parameter.
72
or press DELETE to
Chapter 6 • Working with the Business Component Keyword View
Working with Parameters
You can define input parameters that pass values into your business
component and output parameters that pass values from your component
to external sources or from one step to another step. You can then use these
parameters to parameterize input and output values in steps.
You can define two types of parameters—local parameters and component
parameters.
Local parameter—A local parameter is defined for a specific business
component. It is not accessible by other business components. You define
local parameters in the Business Component Keyword View using the
Configure Value Options dialog box for input parameters and the Output
Options dialog box for output parameters. You cannot delete local
parameters, but you can cancel the input or output to them.
Component parameter—A component parameter is a parameter that may
be used by multiple business components. You define component
parameters in the Parameters tab of the Business Component Settings dialog
box or in the Quality Center Business Components module.
This section describes how to configure local parameters and parameterize
input and output values using local and component parameters. For
information on configuring component parameters, see “Defining
Parameters for Your Component” on page 103.
After you define a parameter you can use it to parameterize a value.
Alternatively, you can apply a constant value to the parameter by typing it
directly in the Value cell.
Parameterizing Input Values
In the Value cell, you can parameterize input values for a step using local or
component parameters.
73
Chapter 6 • Working with the Business Component Keyword View
To parameterize an input value using a local parameter:
1 In the Value cell, click the parameterization button
The Value Configuration Options dialog box opens.
or press CTRL + F11.
Note: If at least one input component parameter is defined in the
component, the default input type is Component parameter and the default
input name is the first output parameter displayed in the Parameters tab of
the Business Component Settings dialog box.
74
Chapter 6 • Working with the Business Component Keyword View
2 In the Parameter box, select Local parameter. The details for the local
parameter type are displayed.
3 Specify the property details for the local parameter:
➤ Name—Enter a meaningful name for the parameter or choose one from
the list.
➤ Value—Enter an input value for the parameter. If you do not specify a
value, QuickTest assigns a default value, as follows:
Value Type
QuickTest Default Value
String
Empty string
Boolean
True
Date
The current date
Number
0
Password
Empty string
➤ Description—Enter a brief description for the parameter.
4 Click OK. The local parameter is displayed in the Value cell of your step.
When the component is run, it will use the value specified in the parameter
for the step.
75
Chapter 6 • Working with the Business Component Keyword View
Tips: You can cancel the parameterization of a value by selecting the
Constant option in the Value Configuration Options dialog box and
entering a constant value.
If you click in the Value cell after you define a local parameter for it, the
icon is displayed in each part of the cell for which a local parameter is
defined.
To parameterize an input value using a component parameter:
1 In the Value cell, click the parameterization button
The Value Configuration Options dialog box opens.
76
or press CTRL + F11.
Chapter 6 • Working with the Business Component Keyword View
Note: If at least one input component parameter is defined in the
component, the default input type is Component parameter and the default
input name is the first output parameter displayed in the Parameters tab of
the Business Component Settings dialog box.
If no component parameter is defined, you must define one before you can
use it to parameterize an input value. For more information, see “Defining
Parameters for Your Component” on page 103.
2 In the Name box, select the component parameter you want to use for the
parameterized value. The details for the component parameter are displayed
as read-only.
3 Click OK. The component parameter is displayed in the Value cell of your
step. When the component is run, it will use the value specified in the
parameter for the step.
Tips: You can cancel the parameterization of a value by selecting the
Constant option in the Value Configuration Options dialog box and
entering a constant value.
If you click in the Value cell after you define a component parameter for it,
the
icon is displayed in each part of the cell for which a component
parameter is defined.
77
Chapter 6 • Working with the Business Component Keyword View
Parameterizing Output Values
You can parameterize output values for a step using local or component
parameters, in the step Output cell. You can then use the output parameter
value as an input value in a later step in the component, or in a later
component in the business process test.
To parameterize an output value using a local parameter:
1 In the Output cell, click the output value button
Output Options dialog box opens.
or press CTRL + F11. The
Note: If at least one output component parameter is defined in the
component, the default output type is Component parameter and the
default output name is the first output parameter displayed in the
Parameters tab of the Business Component Settings dialog box.
78
Chapter 6 • Working with the Business Component Keyword View
2 In the Output Types box, select Local parameter. The details for the local
parameter type are displayed.
3 Specify the property details for the local parameter:
➤ Name—Enter a meaningful name for the parameter or choose one from
the list.
➤ Description—Enter a brief description for the parameter.
4 Click OK. The local parameter is displayed in the Output cell of your step.
When the component is run, it will output the value to the output
parameter specified for the step.
Tip: If you click in the Output cell after you define a local parameter for it,
the
icon is displayed in each part of the cell for which a local parameter
is defined.
79
Chapter 6 • Working with the Business Component Keyword View
To parameterize an output value using a component parameter:
1 In the Output cell, click the output value button
Output Options dialog box opens.
or press CTRL + F11. The
Note: If at least one output component parameter is defined in the
component, the default output type is Component parameter and the
default output name is the first output parameter displayed in the
Parameters tab of the Business Component Settings dialog box.
If no component parameter is defined, you must define one before you can
use it to parameterize an output value. For more information, see “Defining
Parameters for Your Component” on page 103.
2 In the Name box, select the component parameter in which to store the
output value. The details for the component parameter are displayed as
read-only.
80
Chapter 6 • Working with the Business Component Keyword View
3 Click OK. The component parameter is displayed in the Output cell of your
step. When the component is run, it will output the value to the output
parameter specified for the step.
Tip: If you click in the Value cell after you define a local parameter for it,
the
icon is displayed in each part of the cell for which a local parameter
is defined.
Working with Comments
A Comment is a free text entry that can be entered in a business component.
The
icon indicates a comment in the Keyword View. You can use
comments for several purposes. For example, you may want to plan steps to
be included in a business component before your application is ready to be
tested. Then, when your application is ready to be tested, you can use your
plan to verify that every item that needs to be tested is included in the
component steps.
You may want to add comments to a business component to improve
readability and make it easier to update. For example, you may want to add
a comment before each section of a component to specify what that section
includes.
You may also want to use the Comment option to add notes to your
application area. For example, you may want to add a suggestion that will
be displayed in the Steps tab when the Subject Matter Expert creates a new
business component based on a specific application area, or you may want
to make notes to yourself about tasks to do.
After you add a comment, it is always visible in your component, as long as
one or more columns are displayed. For information on selecting columns
to display, see “Setting Keyword View Display Options” on page 19. In
addition, as you scroll from side to side across the grid, the comment can
always be seen. QuickTest does not process comments when it runs a
business component.
81
Chapter 6 • Working with the Business Component Keyword View
Note: After you insert a comment, you cannot change it to a step.
To add a comment to your component:
1 Choose Insert > Comment, click in the Item cell and choose Comment from
the displayed list, or right-click on a component step and select Insert
Comment. A comment row is added below the selected step.
2 Enter text in the Comment row. If you do not enter text, QuickTest deletes
the comment when the cursor focus is removed.
To modify an existing comment:
Double-click the comment. The text box becomes a free text field.
Alternatively, you can click the
icon, which acts as a toggle, making the
comment either editable or read-only.
To delete a comment:
1 Select the comment and choose Edit > Delete, press the DELETE key on your
keyboard, or right-click and select Delete from the context-sensitive menu.
2 Click Delete Comment to confirm. The comment is permanently removed
from the business component.
82
Chapter 6 • Working with the Business Component Keyword View
Managing Component Steps
You can move a component step before or after any other step or comment
in your component. You can also delete it if it is no longer required.
Moving a Component Step
You can move a step to a different location within a component.
To move a step in the component:
➤ In the Item column, drag the step up or down and drop it at the required
location.
➤ Copy or cut the step to the Clipboard and then paste it in the required
location. You can use Edit > Copy or CTRL + C to copy the step, and
Edit > Cut or CTRL + X to cut the step, and Edit > Paste or CTRL + V to paste
the step.
Deleting a Component Step
You can delete a component step, if required. Before you delete a step, make
sure that removing it will not prevent the component from running
correctly.
Note: You cannot delete a step if one of its cells is in edit mode.
To delete a step:
1 Select the step that you want to delete and choose Edit > Delete, press the
DELETE key, or right-click on the step and select Delete from the
context-sensitive menu. A warning message displays.
2 Click Delete Step to confirm. The step is deleted from the component.
83
Chapter 6 • Working with the Business Component Keyword View
84
7
Defining Business Component and
Application Area Settings
You can define specific settings for an individual component or for an
application area. Settings defined for an application area are automatically
copied to any component based on that application area.
This chapter describes:
➤ About Working with Business Component and Application Area Settings
➤ Accessing the Settings Dialog Boxes
➤ Defining Properties for Your Component or Application Area
➤ Defining a Snapshot for Your Component
➤ Defining Application Settings for Your Component or Application Area
➤ Defining Resources for Your Component or Application Area
➤ Defining Parameters for Your Component
➤ Defining Recovery Scenario Settings for Your Component or Application
Area
85
Chapter 7 • Defining Business Component and Application Area Settings
About Working with Business Component and Application
Area Settings
Before you create or debug a business component, you can use the Business
Component Settings dialog box to modify your options for the specific
component. You can also define settings for an application area using the
Application Area Settings dialog box. When you (or a Subject Matter Expert)
create a new component, the component automatically inherits the settings
defined in the application area on which it is based.
When you create a new component, the Business Component Settings
dialog box displays the settings that were defined for the application area on
which the component is based. Any settings that you define locally in the
Business Component Settings dialog box override the settings inherited by
the component from its application area. For example, if the
MyRepository.tsr shared object repository was defined in the application
area on which the component is based, and you select a different shared
object repository (for example, ForComponent.tsr) for the specific
component, the business component will access the ForComponent.tsr
shared object repository. This enables you to customize specific business
components, if needed.
Note: If resources are used in component steps, and you later modify these
resources (either for a specific component or for the application area on
which the component is based), your component may not run correctly.
For example, if a component uses test objects from the MyRepository.tsr
shared object repository, and you change the shared object repository by
choosing ForComponent.tsr, the component will not be able to access the
required test objects because they are located in a different shared object
repository.
If you modify resources for an application area, it is recommended to notify
the Subject Matter Experts working with components based on the
application area to update their components with the latest changes. For
more information, refer to the Business Process Testing User’s Guide.
86
Chapter 7 • Defining Business Component and Application Area Settings
Accessing the Settings Dialog Boxes
The Business Component Settings dialog box and the Application Area
Settings dialog box enable you to define specific options for a component or
application area.
The Business Component Settings dialog box and the Application Area
Settings dialog box are similar. Any differences are pointed out in the
relevant sections in this chapter.
To open the relevant Settings dialog box:
1 Open the component or application area whose settings you want to define.
2 Choose Component > Settings or Application Area > Settings, or click the
Business Component Settings or Application Area Settings toolbar button.
The Business Component Settings dialog box or Application Area Settings
dialog box opens. It is divided by subject into tabbed pages.
87
Chapter 7 • Defining Business Component and Application Area Settings
3 Select the required tab and set the options as necessary. See the table below
for more information on the available options in each tab.
4 Click Apply to apply your changes and keep the dialog box open, or click OK
to save your changes and close the dialog box.
Note: If you close the Application Area Settings dialog box before you select
a shared object repository in the Resources tab, a message box opens asking
you to select a shared object repository for the application area. It is strongly
recommended that you use a different shared object repository for each
application area (and not use the default shared object repository provided
with QuickTest).
The Business Component Settings dialog box and the Application Area
Settings dialog box contain the following tabbed pages:
88
Tab Heading
Tab Contents
Properties
Options for setting the properties of the component,
for example, its description and associated add-ins. For
more information, see “Defining Properties for Your
Component or Application Area” on page 90.
Snapshot
Options for capturing a snapshot image to be saved
with the component for display in Quality Center.
This tab is not available for application areas. For more
information, see “Defining a Snapshot for Your
Component” on page 96.
Applications
Options for specifying the Windows-based
applications on which the component can record and
run. For more information, see “Defining Application
Settings for Your Component or Application Area” on
page 98.
Chapter 7 • Defining Business Component and Application Area Settings
Tab Heading
Tab Contents
Resources
Options for specifying resources you want to associate
with your component, including the location of any
function library files and the shared object repository
to use with your component. For more information,
see “Defining Resources for Your Component or
Application Area” on page 101.
Parameters
Options for specifying input and output parameters
for your component. This tab is not available for
application areas. For more information, see “Defining
Parameters for Your Component” on page 103.
Recovery
Options for setting how your component recovers
from unexpected events and errors that occur in your
testing environment during a run session. For more
information, see “Defining Recovery Scenario Settings
for Your Component or Application Area” on
page 106.
In addition to these tabs, the Business Component Settings dialog box or
Application Area Settings dialog box may contain additional tabs for
scripted components. There may also be other tabs corresponding to any
built-in or external add-ins that are loaded, for example, Web or SAP. For
information on tabs related to built-in add-ins, refer to the QuickTest
Professional User’s Guide. For information on tabs related to external add-ins,
refer to the relevant QuickTest add-in documentation.
89
Chapter 7 • Defining Business Component and Application Area Settings
Defining Properties for Your Component or Application
Area
You can use the Properties tab to view and define general information about
your component or application area, including its description and any
add-ins associated with it. For an application area, it is important to include
a clear description because the name and description are the only
indications that a Subject Matter Expert has when determining which
application area to choose for a specific business component. For a
component, you can also set its status, and you can choose whether
iterations can be specified for it in Quality Center.
The Properties tab includes the following items:
90
Option
Description
Name
Indicates the name of the component or application area.
You assign a name to the component or application area
when you save it.
Author
Indicates the Quality Center user name of the person who
created the component or application area.
Chapter 7 • Defining Business Component and Application Area Settings
Option
Description
Application Area
Indicates the name of the application area on which the
component is based. This option is not displayed for
application areas. For more information, see “Creating a
New Business Component,” on page 43.
Note: If no application area is available, this is indicated by
Not selected. Before business component steps can
be implemented, an application area must be
selected.
Location
Indicates the Quality Center path and filename of the
component or application area. If the component or
application area is not yet saved, the location indicates Not
saved.
Description
Indicates the description specified for your component or
application area.
For business components, this field is read-only and can be
modified only in Quality Center.
For application areas, this field is mandatory and it is
important that it includes a clear description of the
application area. This is because the Subject Matter Expert
decides which application area to choose when creating a
new component in Quality Center based on the Name and
Description of the application area. For more information,
refer to the Business Process Testing User’s Guide.
You can update the description, as needed. For example, if
you created an application area but have not finished
defining it, you can note this in the Description area. Later,
after you finalize the application area, you can update the
Description. Then, you can notify the Subject Matter
Experts to update the application area associated with their
components with the latest changes. For information on
how to update the application area for a business
component in Quality Center, refer to the Business Process
Testing User’s Guide.
Note: For an application area, if you do not enter a
description here in the Properties tab, you are
prompted to do so when saving the application area.
For more information, see “Saving an Application
Area” on page 35.
91
Chapter 7 • Defining Business Component and Application Area Settings
Option
Description
Associated add-ins
Displays the add-ins associated with the component or
application area. The associated add-ins are those that are
loaded by business components when they are accessed. For
more information, see “Associating Add-ins with Your
Component” on page 94.
Modify
Enables you to select the add-ins to associate with your
component or application area. For more information, see
“Modifying Associated Add-Ins” on page 95.
Business
Component Status
Specifies the status of the component. You can change the
status of the component by selecting a different option
from the list. This option is not displayed for application
areas. For more information about status options, see
“Understanding Component Statuses”, below.
Allow iterations
Controls whether iterations can be specified for this
component in a Quality Center business process test. This
option is not displayed for application areas.
Component iterations are defined in Quality Center, using
the Details tab in the Business Components module.
However, some components may not be designed for
multiple iterations, if the last step in the component does
not end at the same point in the application as the first
step.
In such cases, you can clear the Allow iterations check box
to prevent iterations from being allowed for the component
in Quality Center.
This option can also be modified directly in Quality Center
by the Subject Matter Expert.
92
Chapter 7 • Defining Business Component and Application Area Settings
Understanding Component Statuses
Business components can be assigned statuses either in QuickTest or in
Quality Center. A business component status can either be manually
specified, or in certain cases may be automatically assigned by Quality
Center. For example, you can use a Ready status to indicate that a business
component is ready to be run in a business process test, or a component that
has errors that prevent it being successfully run in a business process test
may automatically be assigned an Error status.
Knowing the status of a business component is important because it affects
the status of any business process tests of which it is a part. In general, the
component with the most severe status determines the status of the business
process test. For example, a business component with an Error status causes
any business process test of which it is a part to have an Error status.
A component can be assigned one of the following statuses:
➤ Error—The component contains errors that need to be fixed, for example,
due to a change in the application. When a business process test contains a
component with this status, the status of the entire business process test is
also Error.
➤ Maintenance—The component is currently being developed and tested and
is not yet ready to run, or it was previously implemented and is now being
modified to adapt it for changes that have been made in the application.
➤ Ready—The component is fully implemented and ready to be run. It
answers the requirements specified for it and has been tested according to
the criteria defined for your specific system.
➤ Under Development—The component is currently under development. This
status is initially assigned to:
➤ New components created in the Business Components module of Quality
Center with Business Process Testing support.
➤ Component requests dragged into the component tree in Quality Center
with Business Process Testing support.
93
Chapter 7 • Defining Business Component and Application Area Settings
Associating Add-ins with Your Component
When you open QuickTest, you can select the add-ins to load from the
Add-in Manager dialog box. You can record on any environment for which
the necessary add-in is loaded.
Choosing to associate an add-in with your component (using the
Application Area Settings dialog box or the Business Component Settings
dialog box) instructs QuickTest to check that the associated add-in is loaded
each time you open that component. When you create a new component,
the default associated add-ins are those defined in the application area on
which the component is based.
When you open a component, QuickTest notifies you if an associated add-in
is not currently loaded, or if you have loaded add-ins that are not currently
associated with your component. This process ensures that your run session
will not fail due to unloaded add-ins and reminds you to add required addins to the associated add-ins list if you plan to use them with the currently
open component.
When a Subject Matter Expert opens a business process test in Quality
Center, the QuickTest Professional add-ins that are associated with the first
component in the business process test are loaded automatically. Add-ins
associated with other components in the business process test are not
loaded. Therefore, it is important to ensure that all required QuickTest
add-ins are associated with the first component in the business process test.
94
Chapter 7 • Defining Business Component and Application Area Settings
Modifying Associated Add-Ins
You can associate or disassociate add-ins with your component in the
Modify Associated Add-ins dialog box.
This dialog box lists all the add-ins currently associated with your
component, as well as any other add-ins that are currently loaded in
QuickTest. Add-ins that are associated with your component but not
currently loaded are shown dimmed.
You can select the check boxes for add-ins that you want to associate with
your component, or clear the check boxes for add-ins that you do not want
to associate with your component.
In the above example:
➤ Web is loaded and associated with the component.
➤ ActiveX is loaded, but not associated with the component.
➤ Visual Basic is associated with the component, but is not loaded.
95
Chapter 7 • Defining Business Component and Application Area Settings
Note: If a specific add-in is not currently loaded, but you want to associate it
with your component, reopen QuickTest and load the add-in from the Addin Manager. If the Add-in Manager dialog box is not displayed when you
open QuickTest, you can choose to display it the next time you open
QuickTest. To do so, select Display Add-in Manager on startup from the
General tab of the Options dialog box. For more information, refer to the
QuickTest Professional User’s Guide.
Defining a Snapshot for Your Component
The Snapshot tab of the Business Component Settings dialog box enables
you to capture an image and save it with the component. This image is
displayed in the business process test in Quality Center and provides a visual
indication to the Subject Matter Expert of the main purpose of the
component. The Snapshot options are not available for application areas.
96
Chapter 7 • Defining Business Component and Application Area Settings
Note: The snapshot image can also be captured and saved with the
component from the Snapshot tab in Quality Center when installed with
Business Process Testing support.
For information about capturing a snapshot for a component in Quality
Center, refer to the Business Process Testing User’s Guide.
The Snapshot tab contains the following options:
Option
Description
Capture snapshot from
application
Enables you to define the image to be captured by
clicking the Capture Snapshot button. You can then
drag the crosshairs pointer to select the area to be
captured. When you release the mouse button, the
captured area is displayed in the Snapshot pane.
Load from file
Specifies the .png or .bmp file containing the
required image. You can enter the path and
filename or use the browse button to locate the file.
When you click Apply or OK, the image is saved with the component and is
displayed in the business process tests containing this component in
Quality Center.
97
Chapter 7 • Defining Business Component and Application Area Settings
Defining Application Settings for Your Component or
Application Area
In the Applications tab, you can specify the Windows-based applications on
which the component (or components based on the current application
area) can record and run. You can record steps only on the specified
applications.
You can also view the environments on which the component can currently
record (based on the currently loaded add-ins).
Notes: If you are recording a new component and have not yet set your
application settings in the Applications tab of the Business Component
Settings dialog box, the Applications dialog box opens when you start to
record. The Applications dialog box contains the same options as the
Applications tab, described in this section.
The Applications dialog box and Applications tab may also contain options
applicable to any QuickTest external add-ins installed on your computer. For
information regarding these options, refer to the documentation provided
with the specific add-in.
98
Chapter 7 • Defining Business Component and Application Area Settings
You can use the Applications tab to set or modify your application
preferences in the following scenarios:
➤ You have already recorded one or more steps in the component and you
want to modify the settings before you continue recording.
➤ You want to run the component on a different application than the one you
previously used.
If you are recording a new component and have not yet set your application
settings in the Applications tab of the Business Component Settings dialog
box, the Applications dialog box opens with the same options as in the
Applications tab. For more information on recording, refer to the QuickTest
Professional User’s Guide.
Note: To record on an application, you must open it manually. There are no
settings available for automatically opening applications for components.
The following options are available in the Applications dialog box and the
Applications tab:
Option
Description
Application
Lists the applications on which to record the component.
If you do not want to record on any Windows application,
leave the Application area blank. (This is the default setting.)
You can manually add standard Windows steps to your
component and then run them, even if the Application area is
left blank (or does not list the application for which you want
to add a step).
Add
Adds an application to the application list. You can add up to
ten applications. For more information, see “Specifying an
Application for a Component”, below.
Delete
Removes the selected application from the Application area.
99
Chapter 7 • Defining Business Component and Application Area Settings
Specifying an Application for a Component
When you click Add in the Applications tab, the Select Application dialog
box opens. You can specify the executable file on which you want QuickTest
to record your component.
You can enter the path and filename of the executable file in the Executable
file box, or click the browse button to locate the file.
100
Chapter 7 • Defining Business Component and Application Area Settings
Defining Resources for Your Component or Application
Area
You can use the Resources tab to associate specific files with your
component or application area, such as VBScript function library files. You
can also specify the location of the shared object repository file to use for
your component or application area. All specified resources files must be
saved in your Quality Center project.
The Resources tab includes the following items:
Option Area
Description
Libraries
Displays the list of library files currently associated with your
component or application area and enables you to add, delete,
and prioritize the files. You can associate only library files that
are stored in your Quality Center project. For more information
about function library files, see “Working with Associated Library
Files” on page 127.
Note: QuickTest provides you with sample library files
containing pre-defined functions. These files are
associated by default with all new components and
application areas.
101
Chapter 7 • Defining Business Component and Application Area Settings
Option Area
Description
Check Syntax
Verifies whether any of the associated library files contain syntax
errors that will prevent the component from running properly.
Click the Check Syntax button to check the files for syntax errors
before finalizing the application area. If any syntax errors are
found, a dialog box opens listing the files containing syntax
errors. Otherwise, an information box opens confirming that the
syntax in all of the library files is valid.
Note: When you work with (or debug) a business component, if
you choose an operation from an invalid function library,
a warning message displays. You can verify which of the
associated files has invalid syntax by clicking the Check
Syntax button in the Resources tab of the Business
Component Settings dialog box or Application Area
Settings dialog box. For more information, see “Selecting
the Operation for Your Step” on page 67.
Object
repository
location
Specifies the location of the shared object repository file to use
with your component or application area. Components use
shared object repository files stored in Quality Center.
For each application area, it is strongly recommended to use a
unique shared object repository—not the default shared object
repository provided with QuickTest.
Although QuickTest provides you with a default shared object
repository (located in the Subject/BPT Resources/Object
Repositories folder), it is strongly recommended not to use it. If
you associate this default shared object repository with your
application area or a specific component, any components using
this shared object repository may not run correctly. To choose a
different object repository file or create a new one, enter the full
Quality Center path and filename or use the browse button to
locate the file.
102
Chapter 7 • Defining Business Component and Application Area Settings
Defining Parameters for Your Component
In the Parameters tab, you can define input component parameters that pass
values into your component and output component parameters that pass
values from your component to external sources. You can also use the
Parameters tab to modify or delete existing component parameters. The
Parameters options are not available for application areas.
Component parameters are parameters that can be used to parameterize
input and output values in component steps. For information on using
parameter values in component steps, see “Working with Parameters” on
page 73.
The Subject Matter Expert can also define component parameters in Quality
Center. For information, refer to the Business Process Testing User’s Guide.
The Parameters tab contains two parameter lists:
➤ Input parameters—Specifies the parameters that the component can receive
values from the source that runs or calls it.
➤ Output parameters—Specifies the parameters that the component can pass
to the source that runs or calls it.
You can edit an existing parameter by selecting it in the appropriate list and
modifying its details (except for its name which cannot be modified).
103
Chapter 7 • Defining Business Component and Application Area Settings
Note: The input and output parameter lists can also be modified in the
Quality Center Business Components module. For more information, refer
to the Business Process Testing User’s Guide.
You can add and remove input and output parameters for your business
component using the following buttons:
Option
Description
Adds a parameter to the appropriate parameter list. Enter a name for
the new parameter and select the parameter type. Possible value types:
String, Boolean, Date, Number, or Password. You can enter a
description for the parameter, for example, the purpose of the
parameter in the component.
If you are defining an input parameter, a default value for the specified
parameter type is automatically entered. You can enter or modify a
default value for the parameter in the Default Value column. For more
information, see “Defining Default Values for Input Component
Parameters”, below.
Removes the selected parameter from the component.
Defining Default Values for Input Component Parameters
When a business component runs, the actual values used for parameters are
generally those sent by the application calling the component (either
QuickTest or Quality Center) as described in the table below:
Business Component
Called From:
104
Parameter Values Specified In:
QuickTest
Input Parameters tab of the Run dialog box. For
more information, refer to the QuickTest
Professional User’s Guide.
Quality Center
Component Iterations dialog box (Test Plan
module). For more information, refer to the
Business Process Testing User’s Guide.
Chapter 7 • Defining Business Component and Application Area Settings
If, when a component runs, a value is not supplied by QuickTest or Quality
Center for one or more input parameters, QuickTest uses the default value
for the parameter.
When you define a new parameter in the Parameters tab of the Business
Components Settings dialog box, you can specify the default value for the
parameter or you can keep the default value that QuickTest assigns for the
specified parameter type as follows:
Value Type
QuickTest Default Value
String
Empty string
Boolean
True
Date
The current date
Number
0
Password
Empty string
Using Component Parameters in Steps
After you define component parameters, you can use them to parameterize
values in the steps of your component by selecting input component
parameters in the Value Configuration Options dialog box, or by selecting
output component parameters in the Output Options dialog box. You can
also use local parameters in steps. For more information on using
component and local parameters in steps, see “Working with Parameters”
on page 73.
105
Chapter 7 • Defining Business Component and Application Area Settings
Defining Recovery Scenario Settings for Your Component or
Application Area
Recovery scenario settings enable you to specify how a business component
recovers from unexpected events and errors during a run session. The
Recovery tab displays a list of all recovery scenarios associated with the
current component or application area. It also enables you to associate
additional recovery scenarios with the component or application area,
remove scenarios from the component or application area, change the order
in which they are applied to the run session, and view a read-only summary
of each scenario.
You can enable or disable specific scenarios or the entire recovery
mechanism for the component.
You define recovery scenarios for components and application areas in
exactly the same way as for tests. For more information about recovery
scenarios, refer to the QuickTest Professional User’s Guide.
106
Chapter 7 • Defining Business Component and Application Area Settings
The Recovery tab includes the following option areas:
Option Area
Description
Scenarios
Displays the name and recovery file path for each recovery
scenario associated with your component or application area.
You can add, delete, and prioritize the scenarios in the list, and
you can edit the file path for a selected file. For more
information, see “Specifying Associated Recovery Scenarios”,
below.
Scenario
description
Displays the textual description of the scenario selected in the
Scenarios box.
Activate
recovery
scenarios
Instructs QuickTest to check whether to run the associated
scenarios as follows:
• On every step—The recovery mechanism is activated after
every step.
• On error—The recovery mechanism is activated only after
steps that return an error return value.
• Never—The recovery mechanism is disabled.
Note: Choosing On every step may result in slower
performance during the run session.
Specifying Associated Recovery Scenarios
You can select or clear the check box next to each scenario to enable or
disable it for the current component or application area.
You can also edit the recovery scenario file path by clicking the path once to
highlight it, and then clicking it again to enter edit mode. If you modify a
recovery scenario file path, ensure that the recovery scenario exists in the
new path location before running your component.
107
Chapter 7 • Defining Business Component and Application Area Settings
Scenario types are indicated by the following icons:
Icon
Description
Indicates that the recovery scenario is triggered by a specific pop-up
window in an open application during the run session.
Indicates that the recovery scenario is triggered when the property
values of an object in an application match specified values.
Indicates that the recovery scenario is triggered when a step in the
component does not run successfully.
Indicates that the recovery scenario is triggered when a specified
application fails during the run session.
Indicates that the recovery scenario is no longer available for the
component. This may be because the recovery file has been renamed
or moved, or can no longer be accessed by QuickTest. When an
associated recovery file is not available during a run session, a message
is displayed in the results.
You can add, delete, and prioritize the recovery scenario files associated with
your component using the following buttons:
Option
Description
Opens the Add Recovery Scenario dialog box, which enables you to
associate one or more recovery scenarios with the component. For
more information, refer to the QuickTest Professional User’s Guide.
Removes the selected recovery scenario from the component.
Moves the selected scenario up in the list, giving it a higher priority
during the component run session.
Moves the selected scenario down in the list, giving it a lower priority
during the component run session.
Displays summary properties for the selected recovery scenario in
read-only format. For more information, refer to the QuickTest
Professional User’s Guide.
108
8
Working with User-Defined Functions
You can provide additional functionality for tests and components by
making user-defined functions available to them. A user-defined function
encapsulates activities or steps that require programming into operations (or
keywords). These operations can then be used to enhance your test or
component.
This chapter describes how to include additional functionality using the
Function Definition Generator. For more information on registering and
unregistering user-defined functions, refer to the QuickTest Professional User’s
Guide.
Note: The terms function, method, and operation are used interchangeably
in this chapter. This is because in the Business Component Keyword View,
functions and methods are known as operations, which is a more intuitive
term for Subject Matter Experts.
This chapter describes:
➤ About Working with User-Defined Functions
➤ Using the Function Definition Generator
➤ Additional Tips for Working With User-Defined Functions
➤ Working with Associated Library Files
109
Chapter 8 • Working with User-Defined Functions
About Working with User-Defined Functions
You can provide additional functionality for tests and components by
defining user-defined functions. This enables you and other users, such as
Subject Matter Experts, to choose functions that perform complex
operations, such as adding if/then statements and loops to test or
component steps, or working with reserved objects—without needing any
programming knowledge.
You can register a new function to a test object (or override an existing
function) to enable it to be called by that test object. When you register a
function to a test object, you can define it as the default operation for that
test object, if required. If you choose not to define the function as the
default operation for a test object, it will be listed alphabetically within the
list of available operations for that test object.
If you choose not to register a function to a test object, it becomes a global
function. Global functions can be called by selecting the Functions category
in the Step Generator (for tests), or the Operation item in the Keyword View
(for components).
You can make a function available only within a specific action in a test by
defining it in that action using the Expert View. Alternatively, you can make
the function available to multiple tests or components by defining it in a
function library file. Any text file written in standard VBScript syntax can
act as a library file.
After you add the function to a library file, you store the file in your file
system (for tests), or in your Quality Center project (for tests or
components), and associate the file with a test, application area, or specific
component using the Resources tab of the Test Settings dialog box, Business
Component Settings dialog box, or Application Area Settings dialog box
(whichever is relevant). For more information, see “Working with Associated
Library Files” on page 127. As long as the test or component can access these
user-defined functions, these functions can be seen and used in the Step
Generator (for tests), and the Operation column in the Keyword View (for
components).
110
Chapter 8 • Working with User-Defined Functions
Note: If a test or component can no longer access a function that was used
in a step (for example, if the function was deleted from the associated library
file), the
icon is displayed adjacent to the step in the Keyword View.
When you run the test, component, or business process test, an error will
occur when it reaches the step using the non-existent function.
You can define functions manually in an editor or using the QuickTest
Function Definition Generator, which creates the basic function definition
for you automatically. Even if you prefer to define functions directly in an
editor or in the Expert View, you may still want to use the Function
Definition Generator to view the syntax required to add header
information, register a function to a test object, or set the function as the
default method for the test object.
For more information about defining user-defined functions manually, refer
to the QuickTest Professional User’s Guide. For more information on using the
Function Definition Generator to create a user-defined function, see “Using
the Function Definition Generator” on page 112.
111
Chapter 8 • Working with User-Defined Functions
Using the Function Definition Generator
QuickTest provides a Function Definition Generator, which enables you to
generate definitions for new user-defined functions and add header
information to them. You can also use the Function Definition Generator to
register a function to a test object. You fill in the required information and
the Function Definition Generator creates the basic function definition for
you. You can then copy the definition to a library file and associate it with
your test or component, or you can copy the definition directly to a test
script in the Expert View. You can complete the function by adding its
content (code).
Note: If you paste the function directly in the Expert View, the test will be
able to access the function anywhere within the specific action. For more
information, refer to the QuickTest Professional User’s Guide.
You can register the function to a test object. This enables it to be called by
that test object, and displays it in the list of available operations for that test
object in the Step Generator (for tests), and in the Keyword View (for
components). If you do not register the function to a test object, it becomes
a global operation and is displayed in the list of operations in the Operation
box in the Step Generator, and in the Operation list when the Operation
item is selected in the Keyword View. If you register a function, you can
define it as the default operation that is displayed in the Step Generator or
the Keyword View when the test object to which it is registered is selected.
Finally, you can document your user-defined function by defining the
tooltip that displays when the cursor is positioned over the operation in the
Step Generator (for tests), or in the Keyword View (for tests or components).
You can also add a sentence that describes what the step that includes the
user-defined function actually does. This sentence is then displayed in the
Step documentation box of the Step Generator, and in the Documentation
column of the Keyword View.
112
Chapter 8 • Working with User-Defined Functions
As you add information to the Function Definition Generator, the Preview
area displays the emerging function definition. After you finish defining the
function, you can copy the definition to an associated library file, enabling
it to be accessed by multiple tests or components, or you can paste it directly
in a test in the Expert View. You can then add the content (code) of the
function.
The following section provides an overview of the steps you perform when
using the Function Definition Generator to create a function.
To use the Function Definition Generator:
1 Open the Function Definition Generator, as described in “Opening the
Function Definition Generator” on page 114.
2 Define the function and its arguments, as described in “Defining the
Function and Its Arguments” on page 115.
3 Register the function to a test object, if needed. By default, functions that
are not registered to a test object are automatically defined as global
functions that can be called by selecting the Functions category in the Step
Generator, or the Operation item in the Keyword View. Note that if you
register the function to a test object, you can also define the function
(operation) as the default operation for that selected test object. See
“Registering a Function” on page 118.
4 Document the function by adding header information to it, as described in
“Documenting the Function” on page 121.
5 Preview the function before finalizing it, as described in “Previewing the
Function” on page 123.
6 Finalize the function by copying it to an associated library file or to a test
using the Expert View, and adding content to the function, as described in
“Finalizing the User-Defined Function” on page 123.
Note: Each of the steps listed in this section assumes that you have
performed the previous steps.
113
Chapter 8 • Working with User-Defined Functions
Opening the Function Definition Generator
You can open the Function Definition Generator from the Start menu or
from your QuickTest installation folder. You do not need to open QuickTest
to work with the Function Definition Generator.
Note: If you are planning to register functions, before you open the
Function Definition Generator for the first time, make sure that you open
QuickTest at least once. This enables the Function Definition Generator to
access all of the test objects and their operations.
To open the Function Definition Generator:
From the Start menu, choose QuickTest Professional > Tools > Function
Definition Generator. The Function Definition Generator opens.
114
Chapter 8 • Working with User-Defined Functions
Tip: You can also open the Function Definition Generator by doubleclicking the FunctionDefGen.exe file in your <QuickTest installation
path>\Bin folder.
After you open the Function Definition Generator, you can begin to define a
new function, as described in “Defining the Function and Its Arguments”,
below.
Defining the Function and Its Arguments
After you open the Function Definition Generator, you can begin defining a
function and its arguments.
For example, if you want to define a function that verifies the value of a
specified property, you might name it VerifyProperty, define it as a public
function, and assign it the following arguments: test_object (the test object),
prop_name (the name of the property to check), and expected_value (the
expected value of the property).
If you want to register the function to a test object, you must add at least
one argument to it (the first argument must receive the test object). You can
add as many additional arguments as needed. If you register the function to
a test object, but do not define the first argument to receive the test object,
QuickTest automatically requires the first argument to receive the test
object. You must define the required argument(s) for your function to run
correctly.
115
Chapter 8 • Working with User-Defined Functions
The function you define can be public or private. If you define it as public,
the function can be called from any associated test or component file. If you
define it as private, the function can only be called from elsewhere in the
same function library file. Private functions cannot be registered to a test
object.
To define a function and its arguments:
1 In the Name box, enter a name for the new function. The name should
clearly indicate what the operation does so that it can be easily selected
from the Step Generator or the Keyword View. Function names may not
contain non-English letters or characters. In addition, function names must
begin with a letter and cannot contain spaces or any of the following
characters:
! @ # $ % ^ & * ( ) + = [ ] \ { } | ; ‘ : ““ , / < > ?
2 From the Type list, choose Function or Sub, according to what you want to
define.
3 From the Scope list, choose the scope of the function—either Public (to
enable the function to be called by any test or component that is associated
with this function library), or Private (to enable the function to be called
only from elsewhere in the same function library file). By default, the scope
is set to Public. (Only public functions can be registered to a test object.)
Note: If you create a user-defined function manually and do not define the
scope as Public or Private, it will be treated as a public function, by default.
116
Chapter 8 • Working with User-Defined Functions
4 In the Arguments area, specify the argument(s) for the function. You can
add as many arguments as needed. If you are registering the function to a
test object, the value of the first argument must receive the test object. The
name for each argument should indicate the value that needs to be entered.
For example, you may want to name the argument test_object. (If you do
not include this as the first argument in the list, the function will not run
correctly.)
➤ To add an argument, click
and enter a name for the argument. The
argument name should clearly indicate the value that needs to be
entered for the argument. Argument names may not contain
non-English letters or characters. In addition, argument names must
begin with a letter and cannot contain spaces or any of the following
characters:
! @ # $ % ^ & * ( ) + = [ ] \ { } | ; ‘ : ““ , / < > ?
By default, the Pass Mode is set as By value. This instructs QuickTest to
pass the argument to the function by value. If you want to pass the
argument by reference, choose By reference in the Pass Mode box.
➤ To remove an argument, select it and click
from the Function Definition Generator.
. The argument is removed
➤ To set the order of the arguments, use the
and
arrows. The order
of the arguments only affects the readability of the function code (except
if you want to register the public function—in this case, the first
argument must receive the test object).
After you define a public function and its arguments, you can register the
function, as described in “Registering a Function” on page 118.
Alternatively, if you defined a private function and its arguments, or if you
do not want to register the function, you can continue by adding
documentation for the function. For more information, see “Documenting
the Function” on page 121.
117
Chapter 8 • Working with User-Defined Functions
Registering a Function
You can register a public function to a test object to enable the function
(operation) to be performed on a test object. When you register a function
to a test object, you can choose to override the functionality of an existing
operation, or you can register the function as a new operation for the test
object.
After you register a function to a test object, it is displayed as an operation in
the Step Generator when that test object is selected (for tests), and in the
Keyword View Operation list when that test object is selected from the Item
list (for components). When you register a function to a test object, it can
only be called by that test object.
If you choose to register your function to a test object, the Function
Definition Generator automatically adds a RegisterUserFunc statement
with the correct argument values immediately after your function
definition.
When you register a function to a test object, you can optionally define it as
the default operation for that test object. This instructs QuickTest to display
the function in the Operation column, by default, when you or the Subject
Matter Expert choose the associated test object in the Item list. When you
define a function as the default function for a test object, the value True is
specified as the fourth argument of the RegisterUserFunc statement.
If you do not register the function to a specific test object, the function is
automatically defined as a global function. Global functions can be called
by selecting the Functions category in the Step Generator, or the Operation
item in the Keyword View. A list of global functions can be viewed in the
Operation box when the Functions category is selected in the Step
Generator (for tests), and in the Operation list when the Operation item is
selected from the Item list in the Keyword View (for components). Global
functions are displayed alphabetically in the Operation box in the Step
Generator (for tests), and in the Operation cell in the Keyword View (for
components).
118
Chapter 8 • Working with User-Defined Functions
For tests, during run-time, QuickTest first searches the test for the specified
function and then searches the function library files in the order in which
they are listed in the Resources tab. For components, QuickTest searches the
function library files in the order in which they are listed in the Resources
tab. If QuickTest finds more than one function that matches the function
name in a specific test or function library file, it uses the last function it
finds in that test or file. To avoid confusion, it is recommended that you
verify that within the resources associated with a test, application area, or
component, each function has a unique name.
Tip: If you choose not to register your function at this time, you can
manually register it later by adding a RegisterUserFunc statement after your
function as shown in the following example:
RegisterUserFunc “WebEdit”, “MySet”, “MySetFunc”
In this example, the MySet method (operation) is added to the WebEdit test
object using the MySetFunc user-defined function. If you or the Subject
Matter Expert choose the WebEdit test object from the Item list in the
Keyword View, the MySet operation will then be displayed in the Operation
list (together with other registered and out of the box operations for the
WebEdit test object).
You can also register your function to other test objects by duplicating
(copying and pasting) the RegisterUserFunc statement and modifying the
argument values as needed when you save the function code in a library file.
To define this function as the default function, you define the value True as
the fourth argument of the RegisterUserFunc statement, for example:
RegisterUserFunc “WebEdit”, “MySet”, “MySetFunc”, True
Note: A registered or global function can only be called from a test or
component after it is added to the test script or a library file that is
associated with the test or component.
119
Chapter 8 • Working with User-Defined Functions
To register the function to a test object:
1 Select the Register to a test object check box. The options in this area are
enabled.
2 Choose a Test object from the list of available objects. For example, for the
sample VerifyProperty function, you might want to register it to the Link
test object.
3 Specify the Operation that you want to add or override for the test object.
➤ To define a new operation, enter a new operation name in the Operation
box. For example, for the sample VerifyProperty function, you may
want to define a new VerifyProperty operation.
➤ To override the standard functionality of an existing operation, choose
an operation from the list of available operations in the Operation box.
4 If you want the function to be displayed as the default operation in the
Operation column when you or the Subject Matter Expert choose the
associated item, select the Register as default operation check box.
For example, if you were to define the VerifyProperty operation as the
default operation for the Link test object, the value True would be defined as
the fourth argument of the RegisterUserFunc statement, and the syntax
would appear as follows:
RegisterUserFunc "Link", "VerifyProperty", "VerifyProperty", True
After you specify the test object registration information, you add
documentation for the function. For more information, see “Documenting
the Function” on page 121.
120
Chapter 8 • Working with User-Defined Functions
Documenting the Function
The Function Definition Generator enables you to add header information
to your user-defined function. You can add a description, which is displayed
as a tooltip when the cursor is positioned over the operation in the Step
Generator (for tests), and in the Keyword View (for tests or components).
You and Subject Matter Experts can then use this tooltip to determine which
operation to choose from the list of available operations. As the description
text is displayed as a tooltip, it is advisable to keep the text as brief and clear
as possible.
In addition, you can add documentation that specifies exactly what a step
using your function does. You can include the test object name, test object
type, and any argument values in the text. You can also add text manually,
as needed. The text that you add here is displayed in the Step
documentation box in the Step Generator (for tests), and in the
Documentation column of the Keyword View (for tests or components).
Therefore, it must be a clear and understandable English sentence.
For example, using the sample Mercury Tours application, you might define
the following documentation using the Function Definition Generator:
'@Documentation Double-click the <city_name> item in the <Test object name>
<Test object type>.
After choosing values for the arguments in the Keyword View, the above
documentation might appear as follows: Double-click the San Francisco item
in the toPort list.
121
Chapter 8 • Working with User-Defined Functions
Note: Using the Keyword View, both you and Subject Matter Experts can
select the Documentation only option to view or print a list of steps. This
instructs QuickTest or Quality Center to display only the Documentation
column (and any comments for business components). Therefore, the
sentence displayed for the step in this column must also be clear enough to
use for manual testing instructions.
To document the function:
1 In the Description box, enter the text to be displayed as a tooltip when the
cursor is positioned over the function name in the Operation list in the Step
Generator (for tests), and in the Operation column in the Keyword View (for
components).
For example, for the sample VerifyProperty function, you may want to
enter: Checks whether a property value matches the actual value.
2 In the Documentation box, enter the text to be displayed in the Step
documentation box in the Step Generator (for tests), and in the
Documentation column of the Keyword View (for tests or components). You
can use arguments in the Documentation text by clicking
and selecting
the relevant argument. If you selected the Register to a test object check
box, clicking
also enables you to add the Test object name and/or Test
object type items to the documentation column from the displayed list. If
you use these test object and argument items in the Documentation text,
they are replaced dynamically by the relevant test object names and types or
argument values.
For example, for the sample VerifyProperty function, you may want to
enter Check whether the <Test object name> <Test object type> <prop_name>
value matches the expected value: <expected_value>.
In the Keyword View, actual values would be inserted into the sentence, and
the generated documentation would appear as follows: Check whether the
Customer check box Enabled value matches the expected value: True.
After you provide documentation for the function, you can review it. For
more information, see “Previewing the Function” on page 123.
122
Chapter 8 • Working with User-Defined Functions
Previewing the Function
The Preview area displays the function code as you define it, in read-only
format. You can review your function and make any changes, as needed, in
the various areas of the Function Definition Generator.
For example, for the sample VerifyProperty function, the Preview area
displays the following code.
After you review the code, you copy it to the location in which it will be
stored, for example, a library file or a test. For more information, see
“Finalizing the User-Defined Function”, below.
Finalizing the User-Defined Function
After you preview the code, you can copy it to the location in which you
want to store it. If you want to enable multiple tests or components to
access the function, you can store it in a library file and then link the tests or
components to it. You can also copy the function directly to a test (in the
Expert View) to enable the specific test to call the function anywhere within
an action.
After you paste the code in the required location, you can finalize the
function. For example, for the VerifyProperty function, you would copy the
following code and save it in a library file or paste it directly into a test:
‘@Description Checks whether a property matches its expected value
‘@Documentation Check whether the <Test object name> <Test object type>
<prop_name> value matches the expected value: <expected_value>.
Public Function VerifyProperty (test_object, prop_name, expected_value)
End Function
RegisterUserFunc "Link", "VerifyProperty", "VerifyProperty"
123
Chapter 8 • Working with User-Defined Functions
Note that the RegisterUserFunc statement (in the last line) registers the
VerifyProperty function to the Link test object. If you wanted to register the
function to more than one test object, you could copy this line and
duplicate it for each test object, changing the argument values, as required.
To finalize the function, you add its content. For example, if you wanted the
function to verify whether the expected value of a property matches the
actual property value of a specific test object, you might add the following
to the body of the function:
Dim actual_value
' Get the actual property value
actual_value = obj.GetROProperty(prop_name)
' Compare the actual value to the expected value
If actual_value = expected_value Then
Reporter.ReportEvent micPass, "VerifyProperty Succeeded", "The " &
prop_name & " expected value: " & expected_value & " matches the actual
value"
VerifyProperty = True
Else
Reporter.ReportEvent micFail, "VerifyProperty Failed", "The " &
prop_name & " expected value: " & expected_value & " does not match the
actual value: " & actual_value
VerifyProperty = False
End If
To finalize the user-defined function:
1 Click Copy or select the text in the Preview box and press CTRL + C to copy
the code to the Clipboard. Then paste the function in the required
location—either in the Expert View of a test or in a function library file. For
information on working with library files, see “Using Associated Library
Files” on page 129.
Note: For tests, if you define a function directly in an action, the function
can be called only in that action.
124
Chapter 8 • Working with User-Defined Functions
2 Add content to the function code, as required.
Tip: To display the function in the test results tree (Test Results window)
after a run session, add a Reporter.ReportEvent statement to the function
code (as shown in the example above).
Note that if your user-defined function uses a default test object method,
this step will appear in the Test Results window after the run session.
However, you can still add a Reporter.ReportEvent statement to the
function code to provide additional information and to modify the test or
component status, if required.
3 If you pasted the code in a library file, you must associate the library file
with the test, application area, or component to enable access to the
user-defined function(s). You also need to check its syntax to ensure that
tests and components will have access to the functions, and that you and
the Subject Matter Expert will be able to see and use the functions. For more
information, see “Working with Associated Library Files” on page 127.
Additional Tips for Working With User-Defined Functions
When working with user-defined functions, consider the following tips and
guidelines:
➤ If you want to call the function from additional test objects, you can copy
the RegisterUserFunc line, paste it immediately after another function and
replace any relevant argument values.
➤ By default, steps that use user-defined function are not displayed in the test
results tree of the Test Results window after a run session. If you want the
function to appear in the test results tree, you must add a
Reporter.ReportEvent statement to the function code.
125
Chapter 8 • Working with User-Defined Functions
Note: If your user-defined function uses a default test object method, this
step will appear in the Test Results window after the run session. However,
you can still add a Reporter.ReportEvent statement to the function code to
provide additional information and to modify the test or component status,
if required.
➤ For an in-depth view of the required syntax, you can define a function using
the Function Definition Generator and experiment with the various
options.
➤ If you delete a function in use from an associated library file, the test or
component step using the function will display the
icon. In subsequent
run sessions for the test, component, or business process test, an error will
occur when the step using the non-existent function is reached.
➤ If you modify a function library file that is referenced by a test or
component, the changes will be displayed in the Operation column of the
Keyword View only after the test or component is reopened.
➤ When more than one function with the same name exists in the test script
or library file, the last function will always be called. (QuickTest searches the
test script for the function prior to searching the library files.) To avoid
confusion, make sure that you verify that within the resources associated
with a test, component, or application area, each function has a unique
name.
➤ For more information about creating functions and sub-routines using
VBScript, you can view the VBScript documentation from the QuickTest
Help menu (Help > QuickTest Professional Help > VBScript Reference).
126
Chapter 8 • Working with User-Defined Functions
Working with Associated Library Files
You can create VBScript library files containing VBScript functions and
subroutines, and then associate the files with your test or component. You
can call any public VBScript function or subroutine contained within any
library file that is associated with your test or component. Any text file
written in standard VBScript syntax can act as a library file. For more
information about library files, refer to the QuickTest Professional User’s
Guide.
You use the Resources tab of the relevant Settings dialog box to associate
library files. You specify the library files for all new tests in the Test Settings
dialog box. You specify the library files for all new components based on an
application area in the Application Area Settings dialog box. You specify the
library files for a specific component in the Business Component Settings
dialog box. You can also edit the list of associated library files for an existing
test or component in the relevant Settings dialog box. For more
information, see “Defining Business Component and Application Area
Settings” on page 85.
Adding a Library File to Your Quality Center Project
Before you can associate a library file with an application area or a specific
component, the library file must be stored in your Quality Center project.
(You can associate tests with library files that are stored in your file system or
in your Quality Center project.) For components, QuickTest provides a
default location in which you can store your library files: [Quality Center]
Subject\BPT Resources\Libraries.
After you add the library file to your project, you can associate it with a test,
application area, or specific component, as described in “Using Associated
Library Files” on page 129.
To add a library file to your Quality Center project:
1 In QuickTest, save your application area, as described in “Saving an
Application Area” on page 35. This saves the default library file to your
Quality Center project and sets up the required folders. (This step is relevant
only for components.)
2 Create a VBScript library file or text file and save it with a .vbs or .txt suffix
to a convenient location.
127
Chapter 8 • Working with User-Defined Functions
3 Open the Test Plan module in your Quality Center project. For more
information on opening Quality Center projects, refer to the Mercury Quality
Center User’s Guide.
4 Expand the BPT Resources branch in the test plan tree and select Libraries.
5 Click the Attachments tab in the right pane. The Attachments tab opens
and displays the default function library files.
6 In the right pane, click the File button. The Open dialog box opens.
128
Chapter 8 • Working with User-Defined Functions
7 Browse to the location of your saved library file and click Open. The library
file name appears in the Attachments list, together with the size and date
modified. An icon for the application associated with the file appears next
to the file name.
8 In the Description box, add any comments.
9 Close Quality Center, if desired.
10 You can now associate the library file with your application area, test, or
component. For more information, see “Using Associated Library Files”,
below.
Using Associated Library Files
In order to access functions in a library file from your test or component,
you must associate it as a resource file.
Business components can only access library files that are saved in your
Quality Center project. When working with Quality Center and associated
library files, you must save the associated library file as an attachment in
your Quality Center project before you specify the associated file in the
Resources tab of the Test Settings dialog box. You can add a new or existing
library file to your Quality Center project.
To use an associated library file with your test or component:
1 If you want to add a new library file, create a new file in your file system
with a .vbs or .txt extension.
2 Copy the function code that you created using the Function Definition
Generator or manually, and save it in this library file.
3 If you want to associate the library file with an application area or with
components, in the Quality Center Test Plan module, add the library file to
the project as an attachment. (This step is optional for tests.) For more
information, see “Adding a Library File to Your Quality Center Project” on
page 127.
129
Chapter 8 • Working with User-Defined Functions
4 In the QuickTest Test Settings dialog box, Business Component Settings
dialog box, or Application Area Settings dialog box, click the Resources tab.
5 To add a new file to the associated library files list, when connected to
Quality Center, click the Add button. QuickTest adds [QualityCenter], and
displays a browse button so that you can locate the Quality Center path. You
can also type the entire Quality Center path manually. If you do, you must
add a space after [QualityCenter]. For example: [QualityCenter] Subject\Tests.
To add [QualityCenter] to the path (if you are working in a test and are not
currently connected to Quality Center, hold the SHIFT key and click the Add
button. QuickTest adds [QualityCenter], and you enter the path. Note that
QuickTest searches Quality Center project folders only when you are
connected to the corresponding Quality Center project.
If you want to associate a library file from your file system (outside of your
Quality Center project) with a test, click the Add button and browse to the
file.
Tip: You can specify that the library files you added will be associated with
all new tests (not components) by default by clicking the Set As Default
button.
130
Chapter 8 • Working with User-Defined Functions
6 Click the Check Syntax button to check the files for syntax errors. If any
syntax errors are found, a dialog box opens listing the files containing
syntax errors. Otherwise, an information box opens confirming that the
syntax in all of the library files is valid. Note that if a library file contains
syntax errors, the functions you stored in that file will not be accessible and
cannot be used in tests or components that are associated with the library
file.
7 To reorder the library files, use the Up and Down buttons. This specifies the
order in which QuickTest searches for functions.
8 To remove a file from the associated library files list, select the file and click
the Delete button. The library file remains in the Quality Center project or
file system, but is no longer associated with your test or component (and
therefore the function defined in it cannot be accessed by or used in the test
or component).
Note: If the library file was associated with an application area, any
components that were created using that application area before you deleted
the library file from the Resources tab will still be able to access the library
file functions, unless you update the copy of the application area settings
from the business component in Quality Center. For more information on
updating application area settings, refer to the Mercury Business Process
Testing User’s Guide.
You can now view and use all public functions in your function library file
from your test or component. If the library file is associated with an
application area, all new business components based on the application area
will be able to access the functions stored in the library file.
131
Chapter 8 • Working with User-Defined Functions
132
Index
A
adding library files to Quality Center 127
add-ins
associating with a component 94
modifying selection 95
application area 3, 10, 25–39
about 26
adding shared object repository to
Quality Center project 31
choosing shared object repository 33
creating 28
defining settings for 85–108
deleting 39
opening 38
saving 35
specifying library files for 101
Application Area Settings dialog box 85–108
Applications tab 98
Parameters tab 103
Properties tab 28, 90
Recovery tab 106
Resources tab 101
Application Area Settings dialog box,
opening 87
application, sample viii
applications, selecting for a component 98
associated library files 127, 129
associating add-ins with a component 94
B
Business Component Keyword View. See
Keyword View
Business Component Settings dialog box
85–108
Applications tab 98
Parameters tab 103
Business Component Settings dialog box
(continued)
Properties tab 90
Recovery tab 106
Resources tab 101
Snapshot tab 96
Business Component Settings dialog box,
opening 87
business components. See components
business process tests 4
C
columns
display options 19
columns, rearranging 21
columns, viewing 21
comment 3, 10, 59, 81
component iterations, specifying 92
component parameter 18, 69, 70
defining default values for 104
input 4
output 4
parameterizing input 73
parameterizing output 78
using 105
component settings. See Business
Component Settings dialog box
components 10, 41–48, 93
about 41
adding steps 59
creating 43
defining settings for 85–108
definition 4
opening 48
saving 46
specifying library files for 101
133
Index
components, scripted. See scripted
components
connecting to Quality Center 12–14
conventions. See typographical conventions
copying function code 123
creating
application area 28
components 43
customer support, online ix
D
Function Definition Generator (continued)
previewing function code 123
registering a function 118
using 112
function libraries. See associated library files
functions, user-defined. See user-defined
functions
G
glossary of terms 4
guidelines
user-defined functions 125
Debug toolbar 23
Debug Viewer button 22
defining arguments 115
deleting
application area 39
step 83
disconnecting from Quality Center 14
displaying columns 21
documentation
online viii
updates ix
Documentation column 19
Documentation Only option 3, 21
documentation, printed
Installation Guide vii
Shortcut Key Reference Card vii
Tutorial vii
User’s Guide vii
documenting a function 121
image, capturing for a component 96
Item cell 62
Item column 17
Item list 63
item, selecting 62–67
from Item list 63
from shared object repository 63
from your application 64
iterations, specifying for components 92
E
K
environments, specifying for a component
98
keyboard keys 24
Keyword View 3, 10, 41, 57–83
about 58
at a glance 16
column display options 19
columns 17, 21
definition of 4
using keyboard keys in 24
F
File toolbar 22
finalizing function code 123
Function Definition Generator 3, 115
defining a function 115
documenting a function 121
opening 114
134
H
Help, online, from within QuickTest
Professional viii
hiding columns 21
I
Index
L
library files
associated, about 127
specifying for a component or
application 101
local parameter 3, 18, 69, 70
definition of input parameter 5
definition of output parameter 5
parameterizing input 73
parameterizing output 78
M
manual step 10, 59, 81
manual tests 21
Mercury Tours, sample application viii
moving a step 83
N
New Business Component dialog box 43
New button 22
O
object names, modifying 34
Object Repository button 22
Object Selection dialog box 64
Object Spy button 22
Open Application Area dialog box 38, 39
Open button 22
Open dialog box 48
Open Shared Object Repository dialog box
33
opening
application area 38
component 48
operation
arguments 69
selecting for step 67
selecting from Item list 62, 63, 66
Operation cell 67
Operation column 18
Options button 22
Output cell 70
Output column 19
Output Options dialog box 70, 78
output, canceling 72
P
parameter
canceling output to 72
specifying for tests and components
103
working with 73
parameter, component. See component
parameter
parameter, local. See local parameter
previewing function code 123
Print button 22
project (Quality Center)
connecting to 12–14
disconnecting from 14
Q
Quality Center
adding library files to project 127
associating library files 129
capturing a snapshot for a component
connecting to project 12
disconnecting from 14
Quality Center Connection button 22
Quality Center Connection dialog box 12,
14
QuickTest Engineer 5, 10
R
Readme vii
rearranging columns 21
Record button 23
registering a function 118
RegisterUserFunc statement 118
roles 5
Run button 23
S
sample application, Mercury Tours viii
Save Application Area dialog box 35
Save Business Component dialog box 46
135
Index
Save button 22
saving
application area 35
component 46
screen shot. See snapshot
scripted components 51–56
creating 53
Select Application dialog box 100
Select Object for Step dialog box 63
selecting a test object
from Item list 63
from shared object repository 63
from your application 64
selecting an application for a component 98
server
Quality Center, connecting to 12
Quality Center, disconnecting from
14
Settings dialog box 85–108
shared object repository
adding to Quality Center 31
choosing 33
managing 30
modifying test object names 34
Shortcut Key Reference Card vii
shortcut keys 24
snapshot, capturing for a component 96
status of 93
status, component 93
step
adding 59
definition 4
deleting 83
manual 10, 59, 81
moving 83
Stop button 23
Subject Matter Expert 5, 6, 10, 26
support, online ix
test object
adding shared object repository to
project 31
choosing shared object repository 33
managing shared object repository for
30
modifying names of 34
selecting from application 64
selecting from Item list 63
selecting from shared object
repository 63
Test Results button 22
Test Settings button 22
Testing toolbar 23
toolbars
Debug 23
File 22
Testing 23
Tutorial vii
Tutorial, QuickTest Professional vii
typographical conventions x
T
V
technical support. See customer support
terminology, QuickTest Professional 4
Value cell 69
Value column 18
136
U
updates, documentation ix
user roles 6
User’s Guide vii, viii
user-defined function
about 110
adding a tooltip to 121
documenting 121
finalizing 123
Function Definition Generator 112
guidelines for 125
previewing code in Function
Definition Generator 123
registering 118
working with 109–131
Index
Value Configuration Options dialog box 73
values
canceling output 72
input 69
output 70
parameterizing input 73
parameterizing output 78
VBScript library files 127
viewing columns 21
W
Web site, Mercury ix
What’s New in QuickTest Professional vii, 3
137
Index
138