Using Quicktest Professional 8.0 (Basic)
Using Quicktest Professional 8.0 (Basic)
Using Quicktest Professional 8.0 (Basic)
Professional 8.0
(Basic)
Mercury QuickTest Professional
• Introduction to QTP
− QuickTest Professional, the Mercury advanced keyword-driven testing solution
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, Web
services, and terminal emulator applications).
QuickTest Window
The QuickTest window contains the following key elements:
− QuickTest title bar—Displays the name of the currently open test or component.
− Menu bar—Displays menus of QuickTest commands.
− File toolbar—Contains buttons to assist you in managing your test or component.
− Testing toolbar—Contains buttons to assist you in the testing process.
− Debug toolbar—Contains buttons to assist you in debugging your test or component
(not displayed by default).
− Action toolbar—Contains buttons and a list of actions, enabling you to view the details
of an individual action or the entire test flow.
− Test pane—Contains the Keyword View and Expert View tabs.
− Active Screen—Provides a snapshot of your application as it appeared when you
performed a certain step during the recording session.
Continued…
− Data Table—Assists you in parameterizing your test or component. For a test,
the Data Table contains the Global tab and a tab for each action. For a
component, the Data Table contains single tab.
− Debug Viewer pane—Assists you in debugging your test or component. The
Debug Viewer pane contains the Watch Expressions, Variables, and Command
tabs (not displayed by default).
− Status bar—Displays the status of the QuickTest application.
QTP Window
1. Prepare to Record
Objectives
QTP’s Add-ins helps you to create tests and components for applications that use a variety
of environments.
Once an add-in is loaded, you can record on that application in its supported environment
and recognize the objects specific to the application under test (AUT).
QuickTest Professional Options-
>General
A best practice when setting general options for QuickTest are to:
•Deselect all check boxes except “Save data for integrating with performance testing …”
and “Display Add-in Manager on startup”.
•Click on “Restore Layout” button to reset screens to the initial setting when QuickTest was
first installed.
QuickTest Professional Options->Run
A best practice, when setting run options for QuickTest are to:
•Enable the normal mode. this ensures that the execution arrow appears to help with trouble
shooting your test.
•You can choose to have the test results appear after each test run or not.
•Select "Allow other Mercury products to run tests and components"
•Save step screen capture to results " On error and warnings"
Record and Run Settings - Windows
•
•A best practice is to use the options to configure QTP to "Record and run test on any open
Windows- based application"
•This window will appear the first time you click on the Record button in the new test.
•Manually recall this window by selecting Test->Record and Run settings
2. Create a Test
Objectives
• The QuickTest Professional user interface is broken up into a number of functional areas.
You can choose to focus on one or more areas depending on the task you are performing.
Record a Test
• Once the record button is pressed and test steps are performed , QuickTest listens and records
the activities. This results in the recording and storing of each step of the business process. Each
step consists of:
− The object
− The method (operation)
− The method property (a value for the action performed on the object)
• QuickTest should be running before the application under test is invoked. For some
environments, this is mandatory.
Saving a Test
Saving the test in Quality Center
• Only relevant when using QTP with QC
• A bulls-eye symbol in the header with “Open Test from Quality Center” appears
• A folder structure is listed under the parent directory “Subject”
• You have the option to click the File System button on the upper right corner
• Once you have logged into Quality Center:
1. Select your folder
2. Type in the test name
3. Save the file
Save a test in QuickTest Professional
• If you are using QuickTest Professional alone the file system you will save to is under the
QuickTest Professional’s test directory.
• You have the option to save the test results along with the test.
Steps to Run a Test
• When you run a test, QuickTest performs each step as it was recorded.
• You can watch in the AUT as QuickTest performs each step. A yellow arrow in the left margin of the
KEYWORD VIEW points out the step currently running.
• When QuickTest finishes running the test, you can open the Test Results window.
Steps to View the Results
• A Quick Test Professional object is a graphic user element in an application, such as a button
or a drop-down list.
• Objects are categorized into classes. Buttons, Graphic Images and Edit Boxes are a few
examples of class types.
QuickTest Object Properties
• In the example above, there are several objects called Buttons, two of which are:
• Update Order
• Delete Order.
• The only way to distinguish one object from the other of the same class is by the difference in
object characteristics. Specific characteristics of an object within QuickTest are called object
properties.
QuickTest Recognizes Objects
• QuickTest uses a method when it learns objects during the recording process.
• QuickTest first looks at the object you are recording and stores it as a test object,
determining its object class. For example, QuickTest might classify the test object as
a standard Windows dialog box or a web button.
• For each object class, QTP has a default set of properties that it always learns.
• Usually, only a few properties are needed to uniquely identify an object.
Assigning a Logical Name
• After learning the class and properties of an object, QTP assigns a name to the object. This is known
as the object’s logical name.
• QTP refers to the object in a recorded test by using its logical name.
• Edit the logical name to make it more descriptive if you wish.
• The logical name given to an object during recording may be sufficient, but changing a logical name
can give clarity to the test and the documentation that is generated.
Stored Test Objects
• QuickTest updates the object name and documents it in the documentation field of the
Keyword View.
• IMPORTANT: if you start a brand new test, the test will record the original, default object
names in the Object Repository.
4. Synchronization
Objectives
• Define Synchronization.
• Examine when and where synchronization is most helpful.
• Add a synchronization step for a specified object.
What is Synchronization ?
• Synchronization is a step added to a test that instructs QuickTest to wait for the state of a
property on a particular object to change before proceeding to the next step in the test.
• This is done while in RECORD mode.
• The user/test waits for a visual indication that a step has completed so that the user/test can
take the next step.
Some Visual Cue Examples
Quick Test defaults to allocating the same amount of time for every object.
• Wait times often occur before an object becomes available for the next step. For example,
in the Flights application, once the Insert Order button has been clicked, a process bar
must complete to yield the Order No. associated with the reservation. The process bar may
require additional time before the test can proceed. If insufficient time is allocated for these
special circumstances, the test may fail.
The error message “Object not enabled” appears if QuickTest is running a test and
proceeds to the next step before the previous step has fully processed.
Add a Synchronization Step While
Recording
• Synchronization points which instruct QuickTest to pause until an object property achieves a specific
value.The easiest method is to add a synchronization point while recording.
• A Synchronization step can be added manually after a test is recorded , as well.
• Always add the synchronization point immediately after the step to be synchronized.
• From the QTP menu bar, choose INSERT STEP SYNCHRONIZATION POINT
Object Synchronization
• When the synchronization timeout is set for a step, this value is added to the global
timeout value.
• QTP has a default timeout between test steps of 20000 milliseconds (20 seconds).
• This feature applies to environments that do not synchronize automatically.
• Examples of auto-synchronizing environments:
− Web, SAP, TE
5. Checkpoints
Objectives
Using Checkpoints
• A recorded test is not considering valid without verification. Some reasons for this may be
to:
• Confirm that the test’s action procedure intended results.
• These results should adhere to company business rules.
Visual Cues
• A checkpoint is a measurable result or display that indicates the system is functioning as expected.
• For example, when a reservation is created manually in the Flight application, we know that it
succeeded because the application generates an order number.
• This order number is a visual cue. Any event you can see on the screen can be used as a visual
cue.
• QuickTest can check parts of an application which are not visible on-screen.
• For example, QuickTest can check the exact width and height of an object in pixels.
Checkpoint Types
• Note: A checkpoint is a special type of synchronization point. If you are checking the
property of the object that you would normally synchronize on, an additional
synchronization point is necessary.
Standard Checkpoint
A Constant Checkpoint Value
As a default, QuickTest assumes the value to check is a constant. This value is
generated within the AUT.
To add a checkpoint:
1. While in record mode, select INSERTCHECKPOINTSTANDARD
CHECKPOINT. QTP should minimize and the hand icon should appear.
2. Click on the object you wish to check in the AUT.
3. Select “OK” to confirm that the object selected is correct item.
4. The CHECKPOINT PROPERTIES dialog opens.
5. Choose the properties you want by entering a check and unchecking all others.
The value of the selected property appears in the CONSTANT edit box.
6. Modify the value if required.
7. Click OK to insert the checkpoint into the test.
Insert A Checkpoint From The Active
Screen
• What happens when the value of the object you are checking changes from the original
recorded Value (i.e., Agent Name)?
• The test checkpoint must be modified to accommodate changing values.
• You can tell that a checkpoint has been added to a test when you view the Test Result. A
check mark appears next to the step. You cannot modify the name of a checkpoint. As a
best practice, insert a comment to document the reason for the checkpoint.
A Variable Checkpoint Value
• To allow for any value generated by the application for the property you specify, use the regular
• expression capability.
Bitmap Checkpoint
• Checks an area of your Web page or application as a bitmap.
• For example, suppose you have a Web site that can display a map of a city
the user specifies. The map has control keys for zooming. You can record
the new map that is displayed after one click on the control key that zooms
in the map. Using the bitmap checkpoint, you can check that the map zooms
in correctly.
Table Checkpoint
Checks information within a table.
For example, suppose your application or Web site contains a table listing all
available flights from New York to San Francisco. You can add a table
checkpoint to check that the time of the first flight in the table is correct.
• The default QuickTest Professional Keyword View does not show the Comment field.
• Add the comment field by right-clicking on the harder field of the keyword view.
• The list shows displayed fields with a check mark next to them; add the comment field from here.
• When the Comment field is listed in the keyword view, add your comment.
6. Parameters
Objectives
• Input Parameters allow you to replace a static, recorded value in a step with a dynamic
placeholder (parameter), which represents an expandable range of values.
• Input parameter names and their values are located in QuickTest’s Data Table.
• Input parameter values are input into the application from some outside data source.
Steps to Create An Input Parameter
• In the VALUE CONFIGURATION OPTIONS dialog, select the Parameter radio button and ensure that Data
Table is selected from the drop-down list.
• From the Name drop down list, enter a unique column name to create a new column in your data table or
choose an existing column name from the data table.
• Use the default Global data sheet to store values.
• Enter the values that QTP will input after the test executes.
Supply Data to the Parameter
• The design-time table is the central location for storing input parameter values.
• The number of rows in the data table will cause the same number of test execution iterations to be run.
• As a default, the design-time data table is displayed at the bottom of the QuickTest screen.
• If you want to show or hide the data sheet, click on the icon in the toolbar.
Verify The Test Run
• View the Test Results window to verify that each of the rows from the Design Time Data Table was used
during the test run.
• Expand the tree for each iteration (Row#) to view specific information about the execution of the specific
row.
The Run-Time Table
• Set the number of rows that will be driven into the test for the specified field in the Run
• Setting dialog box.
• The possibilities are:
• - Run one iteration
• - Run all rows
• - Run a range of rows
Output Parameter
• An output parameter is a value which comes back from the application under test.
• When you run the test, QuickTest retrieves the current value of the property and enters it
in the run-time Data Table as an output value.
• You can subsequently use this output value variable in your test. We call this data
correlation. This enables you to use data retrieved during other parts of a test.
Steps to Create an Output Parameter
• In the Keyword View, choose a step that contains the field whose value will be output.
• In the Active Screen, right-click on the field whose value you want to output.
• Choose Insert Output Value from the list.
• Verify the object you want to output by clicking OK in the Object Selection window.
Output Value Properties
• Once an output parameter has been created, its value can be used in the
• subsequent steps of the test
Parameterize a Checkpoint
• You can use parameterized expected values to make your checkpoints dynamic. They Can be
set on:
• An object property in the Object Repository.
• A checkpoint on a parameterized field.
Random Number – Input Parameter
• Random Number – QuickTest can generate random numbers and input them as values for
a parameter.By default, the random number ranges between 0-100
• A different random number is generated each time the parameter is called, for each
iteration or for each test run.
• You can modify these settings in the Parameter Options dialog box.
• Name - Create a name that will be used for a specific purpose in the test.
Environment Parameter
• QuickTest can insert a value from the Environment variable list. These values can be either
QuickTest related or they can relate to the system environment.
• Use of an environment parameter requires an understanding of system values and some
programming skills.
• Throughout the test run, the value of an environment variable remains the same,
regardless of the number of iteration performed, unless you reset the value of the variable
in your script.
Types of Environment Variables
• User – Defined Internal
• User – Defined External
• Built – In
User Defined Dialog Box
• When a user-defined environment is set, the dialog box presents a list of both internal and
• external with the associated values.
Built-In Dialog Box
• A different list of choices will appear when the variable type Built-In is chosen.
7. Reusable and Multiple Actions
Objectives
• List the types of actions that can be created.
• Discuss the benefits of reusable actions.
• Call a reusable action from an external test
• Discuss how the reusable actions affect data and parameters.
Types of Actions
There are two kinds of actions:
• Regular (Non-reusable)
• Reusable
• Locally
• Externally
A Test with Multiple Actions
• Actions can be divided into logical sections, like the main sections of a transaction, or by specific
business processes.
• When you create a new test, it contains one action. By dividing your tests into multiple actions, you
can design more modular and efficient tests.
Insert Call to a New Action
• Test data can be passed from one test to another test using the value of an input
parameter.
• This creates a data flow between business processes.
• The value passed from one business process to another will come from the Data Table.
• Be aware of any data dependencies that occur within the business process.
Data Table Sheets - Global
• After reusable actions are created, they can be called into a “Main Calling” test in three ways:
• Call to New Action
• Call to Copy of Action
• Call to Existing Action
One Action used Many Times
• Rather than recording the login process three times in three separate tests, and enhancing
this part of the script (with checkpoints and parameterization) separately for each test, you
can create an action that logs into the application in one test.
Best Practice
• Inserting calls to existing actions makes it easier to maintain our tests; when an object or
procedure in your application changes. It only needs to be updated one time, in the original
action.
Set Actions as Reusable
• Use the Action Properties – General tab to modify the default label.
• This makes the test easier for others to understand when viewing the test from the Keyword
View tree.
• Right-Click on Action and enter a logical name for the business process.
Call An Action
• An external action is a reusable action created in another test. The external action is inserted into
the calling test in a read-only format.
• Data from the external action’s data sheet can be imported as a local, editable copy or kept as read
only. If read-only, the data can only be modified from the original test.
• After a reusable action is called, you will see the parameters contained in each test appear in the
Global or Local sheet depending on where you stored them in the original test.
Action Run Settings
• Since there are two (or more) tests running, one right after another, you may need to specify
the iteration for each separately.
• To affect the run settings for a particular action, set them in the Action Call Properties dialog
box.
• Right-Click on the Action label in the Keyword View, and choose Action Call Properties from the
list provided.
Defining an Action
• The Action Properties dialog box enables you to define options for the stored action.
• You can modify an action name, add or modify an action description, and set an action as
reusable.
Passing Values to a Called Action
• You can also define input and output parameters to be used by the action.
• These settings apply each time the action is called.
Using an Action Parameter
• Once parameters have been set in Action Properties, you can tell QuickTest that the
parameter type being used is an Action Parameter.
The Test Flow List
• Because reusable actions can be used throughout your test or test set, when you delete an
• action, you must decide to delete a specific occurrence of the action and/or all of its calls.
A different message appear when you are about to delete a non-reusable action.
Thank You