Escolar Documentos
Profissional Documentos
Cultura Documentos
VBScript
Today’s Topics
» Introduction to Automation
» QTP Overview
» Create Test
» Recording Modes
Manual Testing
• Time Consuming
• Low reliability
• Human resources
• Coverage
Automation Testing
• Speed
• Repeatability
• Programmable
• Coverage
• Reliability
• Reusability
Which Test cases to Automate?
Usability Testing
• “How easy is the application to use?”
One time testing “ASAP” testing
• “We need to test Now!”
Ad hoc\random testing
• “Based on intuition and knowledge of application”
Features of QTP
» Preparing to Record
» Creating a Basic Test
» Working with Objects
» Using Synchronization
» Using Standard Checkpoints
» Using Parameters and Data-Driven Tests
» Using Multiple and Reusable Actions
» Adding Steps Without Recording
» Creating Tests on a Web Application
» Using Custom Checkpoints
» Using Database Checkpoints
» Object Repository Administration
» Object Recognition Problems and Solutions
» Using Recovery Scenarios
QTP Supported Environments
Add-ins supported by QTP
Test Requirements
1. Create a new order.
2. Verify that the Insert done…. message appears, confirming that the
new order was successfully generated.
3. Document the order number in the test results.
4. Verify that multiple new orders can be created using different
departure and arrival cities.
Test Environment Requirements
» Database
» Host systems
» Input/output data.
» Execute the test case steps manually to determine the expected
results.
Determine the Data to be Used
2. What is the most appropriate Record and Run setting when you
expect that the Windows application will be already running on the
desktop when the test is starts?
a) Record and Run test on any open Windows-based application.
b) Record and Run on these applications (opened on session start).
c) Record and Run on applications opened via the desktop (by the Windows
shell).
d) None of the above.
Review Questions
3. As a best practice, why should you not select any add-in the Add-
In Manager?
4. Why do you select Allow Other Mercury Products To Run Tests
And Components?
Exercise: Preparing the Test Environment
Normal Recording
Analog Recording
Normal Recording
• Default recording mode
• Records objects on application
• Operations performed on them
Recording Modes
Analog Recording
• Records exact mouse and key board operations
• Records every move of the mouse
• Used while recording operations that cannot be recorded at
Object Level
• Cannot edit steps within QTP
Recording Modes
Analog Recording
Screen
Desktop.RunAnalog "Track1"
Window
Today’s Topics
» Object Properties
» Object Repository
» Object Identification
» Synchronization
» Environment Variables
QuickTest Professional Workflow
An Overview of Object Oriented Programming
Object Properties
Mandatory Assistive
Object Properties
Eg, WinEdit
Mandatory Assistive
attachedtext window id
nativeclass ….
…
Objects-Property/Value Pairs
Object Spy
Logical Name
Stored Test Objects
Open the Object Repository Dialog Box
Use Object Repository
Test objects can be stored in two types of object repositories—a shared object repository
and a local object repository. A shared object repository stores test objects in a file that
can be accessed by multiple tests (in read-only mode). A local object repository stores
objects in a file that is associated with one specific action, so that only that action can
access the stored objects.
Types of Object Repository
When you plan and create tests, you must consider how you want to store objects in your
test. You can have separate action repository for each action and stores the objects for
each action in its corresponding action repository or you can store all the objects in your
test in a common (shared) object repository file that can be used for multiple tests
Object Repository
Adding Objects to Object Repository: When you record a test, Quick Test adds
each object on which you perform operation to object repository.
You also add objects to object repository while editing
your test.
Object Identification dialog box to set mandatory and assistive properties, to select the ordinal
identifier, and to specify whether you want to enable the Smart Identification mechanism for each test
object.
Any changes you make in the Object Identification dialog box have no effect on objects already added
to the object repository.
Review Questions
The Environment tab of the Test Settings dialog box (File > Settings) displays
existing built-in and user-defined environment variables. It also enables you to
add, modify, or delete internal user-defined environment variables, save the
defined variables to an external .XML file, and retrieve them from a file.
The Environment tab includes the following options for the Variable type:
Built-in. Displays the built-in environment variables defined by QuickTest
Professional and their current values.
User-defined. Displays both internal and external user-defined environment
variables and their current values.
If you export your user-defined variables to an external .XML file, you can then use
the exported environment variable file with any other test.
Review Questions
Today’s Topics
» Synchronization Point
» Environment Variables
» Reporting in QTP
QuickTest Professional Workflow
Understanding Synchronization
Some Visual Cues
The Environment tab of the Test Settings dialog box (File > Settings) displays
existing built-in and user-defined environment variables. It also enables you to
add, modify, or delete internal user-defined environment variables, save the
defined variables to an external .XML file, and retrieve them from a file.
The Environment tab includes the following options for the Variable type:
Built-in. Displays the built-in environment variables defined by QuickTest
Professional and their current values.
User-defined. Displays both internal and external user-defined environment
variables and their current values.
If you export your user-defined variables to an external .XML file, you can then use
the exported environment variable file with any other test.
Review Questions
» Use Environment variable for username and password to login to the application
» Login to the fight reservation application
» Insert an Order
» Exit from File Reservation application
Use Sync points wherever required and use shared object repository
QuickTest Professional Workflow
Understanding Checkpoints
• XML file checkpoints are used to check a specified XML file; XML
application checkpoints are used to check an XML document within
a Web page.
Accessibility Checkpoint
Check if the images on a Web page include ALT properties, required by the W3C Web
Content Accessibility Guidelines
Syntax
Reporter.ReportEvent EventStatus, ReportStepName, Details
Today’s Topics
» Input parameter
» Output parameter
» Random Number parameter
» Environment parameter
Input Parameters for Data-Driven Tests
Using Design-Time Data Table
Using a Global Data Sheet
Using a Local Data Sheet
Data Table Location
Replacing Static Data with Input Parameters
Setting the Parameter Value
Supplying Data to the Parameter
Setting the Number of Iterations
Test Results Iterations
Using Output Parameter
Inserting an Output Parameter While Recording
Inserting an Output Parameter After Recording
Reusing Output as Input
Parameterizing a Checkpoint
Parameterizing an Object Repository
Random Number Parameter
Environment Parameter
Run-Time Table After Playback
Review Questions
Today’s Topics
Today’s Topics
» List the types of steps that can be added to a test without using the Record feature.
» Use conditional statements in a test.
» Use the Reporter feature to report events as a step in the test.
» Use Step Generator.
» Create a parameterized checkpoint.
» Compare captured parameter values with expected values.
» Use debug tools to investigate and cause failures.
» Verify that the reported error message reflects the state of the test.
» User Defined Functions
» Smart Identification Mechanism
Adding Steps Using Keyword View
» Non-recordable test object methods and operations that you cannot perform on an
application.
12_Using_Database_Checkpoints.zip
Using a Custom Checkpoint
Filter the Objects that do not match the Option Filter List
>1 =0
`
Objects Ignore that Optional Filter Property
=1
End