Qtp Training
-
Upload
venkateswararao-siddabathula -
Category
Business
-
view
21 -
download
2
description
Transcript of Qtp Training
Company
LOGO
Quick Test Professional
Quick Test ProcessQuick Test Process
• Quick Test testing process consists of 7 main phases
• Preparing to record– Test Environment– Test Conditions
• Recording a session on your application– Navigate according to Test Conditions
• Enhancing your test– Adding logic and conditional statements– Parameterization– Inserting checkpoints
• Debugging your test– Check that it operates smoothly and without
interruption.
• Run Test – Check the behavior of your application
• Analyzing the test results
• Reporting defects
QTP Layered ArchitectureQTP Layered Architecture• Logical name
• Physical Description
• Application
• Layer1
• Layer2
• Layer3
QTP High-level featuresQTP High-level features• Object Repository
• Object Spy
• Keyword View
• Expert View
• Active Screen Technology
• Data Tables (Global, Local)
• Object Identification
• Recovery
• Various Add ins
Add insAdd ins
• Default Add ins– ActiveX– Multimedia– Visual Basic– Web
• Available Add ins– Java– .Net– etc..
Recording ModesRecording Modes
• Normal recording– Records the objects in your application
and the operations performed on them. This mode is the default and takes full advantage of Quick Test’s test object model.
• Analog Recording– Record the exact mouse and keyboard
operations you perform in relation to either the screen or the application window.
Recording ModesRecording Modes
• Low-Level Recording– Record on any object in your application,
whether or not Quick Test recognizes the specific object or the specific operation.
Recording ModesRecording Modes
Record and PlaybackRecord and Playback
• Advantages
• Useful in determining how the QTP interacts with the application under test.
• Provides initial ideas on how to develop test scripts.
• Useful while ‘Playing around’ with the tool
• Disadvantages
• Test scripts contains hard-coded values.
• This is not a viable cost-effective test automation approach for long term.
Record and PlaybackRecord and Playback
Object RepositoryObject Repository
Locate object in repository Find data-dependant
property
• Parameterize • property’s • value
• Interface between QTP Script and the Application
• Contains Logical Name and physical Description
Object SpyObject Spy
• It is used to view object properties and Methods
• Displays • Object hierarchy tree • Run-time object methods
or test object methods
Active Screen, Keyword View, Expert View, Data Tables
Active Screen, Keyword View, Expert View, Data Tables
Object IdentificationObject Identification
Company
LOGO
Data Driven Approach
Enhancing TestsEnhancing Tests
1. Parameterizing Tests
2. Creating Output Values
3. Creating Checkpoints
4. Dividing Tests into Multiple Actions
5. Inserting Transactions.
6. Calling External Files.
Parameterizing Tests Parameterizing Tests
Steps for Parameterization
1. Defining a Data Table Parameter
2. Adding Parameter Values to a Data Table
3. Modifying Steps Affected by Parameterization
4. Running and Analyzing a Parameterized Test
Demo………………..
Demo…………..Demo…………..
• How to provide the data to the respective Parameter through Expert View
ResultsResults• After running a test, we can view a report of
major events that occurred during the test run.
• The Test Results window contains a description of the steps performed during the test run.
• If the test contains Data Table parameters, and the test settings it shows on Test Results window.
• Results are grouped by the actions in the test.
Virtual ObjectsVirtual Objects
• QTP teaches to recognize a bitmap area as a standard object except edit.
CheckpointsCheckpointsUsed to check the current behavior of the application with the expected behavior.
Text /Text Area Checkpoint
Standard Checkpoint
Table Checkpoint
Page checkpoint
Database Checkpoint
Image Checkpoint
Accessibility Checkpoint
Bitmap Checkpoint
XML Checkpoint
Synchronization PointSynchronization Point• Synchronization point is used to solve anticipated
timings problems between QTP script and the application.
• Why synchronize– Waiting for a Message box to appear– Wait for a object status – Wait for the page to load
• Methods– Sync– Exist– WaitProperty– Wait
Creating Output ValuesCreating Output Values
• This is just reverse to the Parameterization, In this case QTP takes the data from the application and displays the same in the Data Table.
Company
LOGO
QTP Advanced
Actions (1)Actions (1)
• Actions help to divide Test Script into logical units• Usage :
1)We can design more modular and efficient tests.
2)Actions enable you to parameterize specific components
of a test
3)Two or more tests can call the same action
4)Complex tests may have many actions and may share
actions with other tests.• Example:
Actions (2)Actions (2)
We can divide Test Script into multiple actions by creating
new actions or by inserting existing actions.
Actions Classification:• Non-Reusable Action : An action that can be used only
in the test in which it was created• Reusable Action : An action that can be called multiple
times by the test in which it was created (the local test) as well as by other tests.
• External Action : A reusable action created in another test. External actions are read-only in the calling test. They can be modified only in the test in which they were created.
TransactionsTransactions• A transaction represents the business process that you
are interested in measuring
• You can measure how long it takes to run a section of your test by defining transactions.
• User can Plan the Scenario as transaction and use the Start Transaction and End Transaction while Recording.
Object RepositoryObject Repository
• All object related information is stored • Different from Win Runner (text file) , QTP its
binary file• Type
– Shared (.tsr)– Per action (.mtr)
• Managing Objects– Change a test object property value– SetTOProperty– Add properties– Parameterize a object property with Data table – Regular expressions
Test Object ModelTest Object Model• Set of object types or classes ( WebEdit, WebList, WebTable)• Each object has associated properties and methods.• Recorded properties will help tool to uniquely identify objects
– Mandatory properties– Assistive properties– Ordinal identifier
• Index or location
• Record vs. Replay– Test Object vs. Runtime – Object– Quick Test vs. Object Creator (Microsoft Explorer,Netscape)
• Methods– GetTOProperty, SetTOProperty– GetROProperty
Test Object Model (Test Object Properties)
Test Object Model (Test Object Properties)
Configuring Web Event Recording
Configuring Web Event Recording
• Basic– Records standard events, submit events on
the forms,click events (handler or behavior)
• Medium– Records click event on the <DIV><SPAN>
and <TD> html tag objects, apart from the basic
• High– Records mouseover,mousedown and double-
click events with handler
Test ConfigurationTest Configuration
• Tools-> Options
• Test -> Settings
• Test-> Record and Run Settings
• Setting(testing_option) = new_value
• new_value = Setting(testing_option)
Debugging TestsDebugging Tests
• Using Step Commands
• Pausing Test Runs
• Setting /Removing Breakpoints
• Using Debug Viewer
Recovery ManagerRecovery Manager
• Defining Recovery Scenarios– Trigger Event
• The event that interrupts your test run, for e.g a window pops up
– Recovery Operation• The operation that needs to be performed to
continue the test for e.g clicking “Yes” button?
– Post Recovery Test Run options• What would be your next step?
Create a Recovery ScenarioCreate a Recovery Scenario
• Define Trigger Event,Recovery Operation,Post Recovery option
• Add to the test, using the scenario tab of Test->Settings
• Programmatically Enabling, disabling Recovery Scenarios– Recovery.enabled = true– Recovery.enabled = false
User Defined FunctionsUser Defined Functions
• Working with User Defined Functions
• Working with Associated Library Files– Test ->Settings-> Resources
• Executing externally-defined functions– Executefilename <path>
Integration with WinRunner Integration with WinRunner
By this we will execute WinRunner script from the QuickTest – Call to WinRunner test – Call to WinRunner Function
Integration with Test DirectorIntegration with Test Director
By this integration we will store Test Case in to Test Director and execute remotely.
Q & AQ & A