Qtp Training

41
Company LOGO Quick Test Professional

description

 

Transcript of Qtp Training

Page 1: Qtp Training

Company

LOGO

Quick Test Professional

Page 2: Qtp Training

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

Page 3: Qtp Training

• Enhancing your test– Adding logic and conditional statements– Parameterization– Inserting checkpoints

• Debugging your test– Check that it operates smoothly and without

interruption.

Page 4: Qtp Training

• Run Test – Check the behavior of your application

• Analyzing the test results

• Reporting defects

Page 5: Qtp Training

QTP Layered ArchitectureQTP Layered Architecture• Logical name

• Physical Description

• Application

• Layer1

• Layer2

• Layer3

Page 6: Qtp Training

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

Page 7: Qtp Training

Add insAdd ins

• Default Add ins– ActiveX– Multimedia– Visual Basic– Web

• Available Add ins– Java– .Net– etc..

Page 8: Qtp Training

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.

Page 9: Qtp Training

• Analog Recording– Record the exact mouse and keyboard

operations you perform in relation to either the screen or the application window.

Recording ModesRecording Modes

Page 10: Qtp Training

• 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

Page 11: Qtp Training

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

Page 12: Qtp Training

• 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

Page 13: Qtp Training

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

Page 14: Qtp Training

Object SpyObject Spy

• It is used to view object properties and Methods

• Displays • Object hierarchy tree • Run-time object methods

or test object methods

Page 15: Qtp Training

Active Screen, Keyword View, Expert View, Data Tables

Active Screen, Keyword View, Expert View, Data Tables

Page 16: Qtp Training

Object IdentificationObject Identification

Page 17: Qtp Training

Company

LOGO

Data Driven Approach

Page 18: Qtp Training

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.

Page 19: Qtp Training

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………………..

Page 20: Qtp Training

Demo…………..Demo…………..

• How to provide the data to the respective Parameter through Expert View

Page 21: Qtp Training

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.

Page 22: Qtp Training

Virtual ObjectsVirtual Objects

• QTP teaches to recognize a bitmap area as a standard object except edit.

Page 23: Qtp Training

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

Page 24: Qtp Training

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

Page 25: Qtp Training

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.

Page 26: Qtp Training

Company

LOGO

QTP Advanced

Page 27: Qtp Training

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:

Page 28: Qtp Training

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.

Page 29: Qtp Training

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.

Page 30: Qtp Training

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

Page 31: Qtp Training

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

Page 32: Qtp Training

Test Object Model (Test Object Properties)

Test Object Model (Test Object Properties)

Page 33: Qtp Training

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

Page 34: Qtp Training

Test ConfigurationTest Configuration

• Tools-> Options

• Test -> Settings

• Test-> Record and Run Settings

• Setting(testing_option) = new_value

• new_value = Setting(testing_option)

Page 35: Qtp Training

Debugging TestsDebugging Tests

• Using Step Commands

• Pausing Test Runs

• Setting /Removing Breakpoints

• Using Debug Viewer

Page 36: Qtp Training

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?

Page 37: Qtp Training

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

Page 38: Qtp Training

User Defined FunctionsUser Defined Functions

• Working with User Defined Functions

• Working with Associated Library Files– Test ->Settings-> Resources

• Executing externally-defined functions– Executefilename <path>

Page 39: Qtp Training

Integration with WinRunner Integration with WinRunner

By this we will execute WinRunner script from the QuickTest – Call to WinRunner test – Call to WinRunner Function

Page 40: Qtp Training

Integration with Test DirectorIntegration with Test Director

By this integration we will store Test Case in to Test Director and execute remotely.

Page 41: Qtp Training

Q & AQ & A