Top Banner
SR. NO. WINRUNNER QTP 1 It is a product of Mercury Interactive It is a product of Mercury Interactive/HP 2 It is a W indows Ba sed Appli cation It is a W indows Bas ed Applic ation 3 It supports only Windows Based Application It supports both Windows Based Application and W eb Application 4 It doesnot support test on .Net Application It supports test on .Net Application 5 DataT able and ActiveScreen V iews are Absent Data T abl e and Act ive Scree n V iews are Present 6 Scripting Language is TSL-Test Scripting Language Scripting Language is VB(V isual Basic) Scripting 7 It doesnot support t est on ERP  packages(SAP,Peoplesoft,Oracle abs) It supports test on ERP  package s(SAP ,Peoplesoft,Oracle abs)
101

Qtp Elite)

Apr 09, 2018

Download

Documents

Preetesh Singh
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 1/101

SR.

NO. WINRUNNER QTP

1

It is a product of Mercury

Interactive It is a product of Mercury Interactive/HP

2It is a Windows Based Application It is a Windows Based Application

3It supports only Windows Based

Application

It supports both Windows Based

Application and Web Application

4It doesnot support test on .Net

Application

It supports test on .Net

Application5DataTable and ActiveScreen Views

are Absent

DataTable and ActiveScreen Views

are Present6Scripting Language is TSL-Test

Scripting Language Scripting Language is VB(Visual Basic) Scripting

7It doesnot support test on ERP

 packages(SAP,Peoplesoft,Oracle

abs)

It supports test on ERP

 packages(SAP,Peoplesoft,Oracle abs)

Page 2: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 2/101

By default five views are visible on QTP screen:

1.Keyword View

2.Expert View

3.Active Screen

4.Data Table

5.Information

Other two views are:-

6.Debug Viewer 7.Missing Resources

Page 3: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 3/101

` Keyword View:Place to Develop Code by selecting

objects(keyword)

` Expert View:Developing Code Manually

`  Active Screen:Provides Snapshots for each line of code.

` Datatable:Place to store all test data or inputs

` Information:Provides information for Syntactical

Errors

Page 4: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 4/101

Page 5: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 5/101

Page 6: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 6/101

Page 7: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 7/101

Page 8: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 8/101

Page 9: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 9/101

Page 10: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 10/101

Page 11: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 11/101

Page 12: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 12/101

` It is the First Screen Which appears after openingthe QTP i.e. Add ±in Manager 

Page 13: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 13/101

`  Add in is use to identify particular technology

objects.

` By Default three Add ±In¶s are Available:-`  ActiveX

` Visual Basic

` Web

Other Add ins can also be added like java,.Net.etc

Page 14: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 14/101

` Object Repository is a place where QTP stores

learned objects

` Object Repository: displays a tree of all objects in the

current component or in the current action or entire

test

`  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

`  A shared object repository stores test objects in a file

that can be accessed by multiple tests.

Page 15: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 15/101

Page 16: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 16/101

` Two Types:

` 1.Manual

` 2.Automation

Page 17: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 17/101

`  Automation:

` 1.Requirement Feasiblity

` 2.Developing Test Scripts

`

3.Enchancing the script` 4.Debugging the script

` 5.Executing the script

` 6.Collect the results

`

7.Result Analysis` 8.Find the Bugs

` 9.Log the Bugs

Page 18: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 18/101

` QTP recognizes all objects in the Application

under test using the set of mandatory properties

that it stores for all Test Objects while recording. If 

QTP is not able to recognize the objects using theset of mandatory properties it uses object

identification to assign properties to that Object

using following procedure:-

Page 19: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 19/101

Page 20: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 20/101

Page 21: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 21/101

Page 22: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 22/101

We can Record(F3) the events and later it can be

played back(F5)

Types of Recording:

1. Normal Recording2.  Analog Recording

3. Low Level Recording

It gives 2 options: Record and run test on any open windows-based

application

Record and run on specific application.

Page 23: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 23/101

Page 24: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 24/101

` For playback just run the script.

Page 25: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 25/101

Steps:1. Click on ³Record´ button.

2. Select ³Record Specific application´.

3. Click on ³+´ icon.

4. Click on ³OK´

5. Click on ³Apply´

6. Click on ³OK´

7. Perform some action on application.

8. Click on ³Stop´ button.9. Click on ³Run´.

10. Click on ³OK´

Page 26: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 26/101

When we run test,time taken by different object mayvary.

Three ways of using synchronization: Synchronization Timeout.

It works with seconds File/Settings/Run

It is applicable for all line of code

It depends on task.

Use EXIST or WAIT statements.

It works with seconds

Syntax: wait xx It is applicable for on a point

It depends on time

Page 27: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 27/101

Synchronization point It works with milliseconds In record mode,Click Insert,Click Synchronization

point,Select the object where we want synchronizationpoint then specify the timeout period in milliseconds.

Page 28: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 28/101

Page 29: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 29/101

` Virtual objects are used to give functionality

name to a object.

` A virtual objects are collected and it is stored in

the VirtualObject Manager.

Page 30: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 30/101

Steps: ± Tools>Virtual objects>New Virtual Object

 ± Select class name

 ± Click Next

 ± Click Mark Object

 ± Mark Object with + ± Click on next>next

 ± Provide appropriate functionality name in Name edit box

 ± Provide the appropriate family name in VO collection box

 ± Click Next ,check no and then click Finish

Page 31: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 31/101

Page 32: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 32/101

Checkpoint is a verification point that comparesthe current value for a property with theexpected value for that property.

Types of checkpoint: Standard Checkpoint:Checks values of an object.

Text Checkpoint:Checks that a text string is displayed correctly andat specified location.

Text Area Checkpoint:Checks that a text string is displayed

correctly and at specified location.

Bitmap Checkpoint:Checks an area of an application

Database Checkpoint:Checks the contents of databases

 Accessibilty Checkpoint

Page 33: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 33/101

xXML Checkpoint:Checks the data content of XML documents

Page 34: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 34/101

In record mode,choose

Insert>Checkpoint>Standard Checkpoint.

Select the object .

Click ³OK´

Page 35: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 35/101

Click on notepad symbol.

Enter the Expected Value,click Ok and OK

Page 36: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 36/101

In QTP

1. Linear Framework:Just using Record

2. Modular:Developing the code

modulewise(Manual/Record) and enhancing the code3. Keyword Driven: Giving object and action a keyword

and using it in code

4. Data Driven:Getting each action and permission from

server 5. Hybrid:Combination of two or more framework

Page 37: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 37/101

` It is used when we use function.

` When action is called all four thing are called viz.

code,datatable,active screen and OR

` Instead of that we can use function,where we justlink to a object repository

Page 38: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 38/101

` Steps: Choose Resources>Object Repository>Tools> Associate

Repositories.

Click + icon

Select appropriate file with .tsr extension

Select available action and click->

Click OK

Page 39: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 39/101

Page 40: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 40/101

` In simple words it can be defined as ³Testing an

application with multiple inputs´

` It allows creating maintainable scripts which canrun with different data every time

Page 41: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 41/101

Page 42: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 42/101

Select data to be

parameterized

Click Parameterize

Page 43: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 43/101

Page 44: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 44/101

Give the

column name

Page 45: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 45/101

Page 46: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 46/101

` Recovery scenario helps the user as it indicates

QTP with regards to the corrective action needed

to be taken in case of the unwanted event

occurred during the test run

Page 47: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 47/101

Page 48: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 48/101

Click NEW

Page 49: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 49/101

Select event

Page 50: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 50/101

Click hand icon

select window

Page 51: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 51/101

Name of selected

window

Objects of the

window

Page 52: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 52/101

Select

operation

Page 53: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 53/101

Page 54: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 54/101

Page 55: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 55/101

Select post

recovery options

Page 56: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 56/101

` Output value extracts value from certain field

which can later used as input for other fields

during runtime.

`

To execute output value we have to first record theapplication

Page 57: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 57/101

Page 58: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 58/101

Select the

object

Page 59: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 59/101

Select

property

Page 60: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 60/101

Output Name column iscreated

Page 61: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 61/101

Page 62: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 62/101

Page 63: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 63/101

` Function can be defined as a group of code

which can be called again and again whenrequire with no need to write the code again

& again.

` The syntax for function is

Function function_name

code

}End function

Page 64: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 64/101

Page 65: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 65/101

Function is called

Page 66: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 66/101

` Descriptive programming is used when we

want to perform an operation on an object

that is not present in the object repository.

Page 67: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 67/101

In descriptive programming object is not added in

the object repository.

Thus the object to be used are identified usingobject spy.

The use of invoke is must in descriptive

programming.

Page 68: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 68/101

Page 69: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 69/101

Page 70: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 70/101

` Step generator is a feature available in QTP which

helps to generate the script without recording

and/or without typing the script in Expert View.

Page 71: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 71/101

Page 72: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 72/101

i) Application Under Test should be opened

ii)Press F7 in Qtp

OR

ii) Go to tool bar of the QTP :

-Insert.

-Step Generator.

-Select Category as 'Test Objects' .

-Insert another step should be selected.

on the 'Step Generator' dialog box.

Page 73: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 73/101

i) Application Under Test should be openedii)Press F7 in Qtp

ORii) Go to tool bar of the QTP :

-Insert.

-Step Generator.-Select Category as µFunctionsµ .-Select Library as µAll¶ or µBuilt-in¶-Select Operation as µInvokeApplication¶.-Click Value text box for Command for Argument Option.-In constant Textbox Specify the path of the AUT.

-Insert another step should be selected.on the 'Step Generator' dialog box.

Page 74: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 74/101

` The Function µInvokeapplication¶ is used to Invoke

the application Multiple time.

Expert View

Keyword View

Page 75: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 75/101

OBJECT SPY

Page 76: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 76/101

` The Object Spy enables you to view both the run-

time object methods and the test object methods

associated with an object and to view the syntax

for a selected method.

` You use the Object Spy pointer to point to an

object.

Page 77: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 77/101

` Keep the application ,on which we want to use

object spy, in an Open state.

` Click the object spy icon on Tool bar 

Page 78: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 78/101

Click On Hand icon

Page 79: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 79/101

` Click on Hand icon in Object spy Window.

` Then Select the Object in the Application by

Pointing the hand icon over it and then Clicking it

once.

Page 80: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 80/101

Page 81: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 81/101

Object Hierarchy

tree

Properties Values

Object Methods

Page 82: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 82/101

Object Methods

Page 83: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 83/101

Descriptive ProgrammingCheck the Syntax for an object

Page 84: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 84/101

Connecting QTP to QC

Page 85: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 85/101

` To connect QTP and QC we need to install

TD or QC plug-in .

Page 86: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 86/101

1) Click File -> Quality Center Connection.

Page 87: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 87/101

3)Click Connect Button

4)Provide the User name & Password

Page 88: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 88/101

) &

5)Click Authenticate

6)Select the domain and project

Page 89: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 89/101

) p j

7)Click Login

Page 90: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 90/101

Icon indicates that QTP is connected to

QC

8)Click save As

Page 91: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 91/101

8)Click save As

9)Now all QTP files will be saved

to Quality center 

Page 92: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 92/101

Page 93: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 93/101

1.Record the code

2.Go to Resources>Object Repository

3.Go to description and click on <#>

4.Change variable data of constant field by *.*

Page 94: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 94/101

Page 95: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 95/101

Page 96: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 96/101

This symbol

indicates

Object is a Regular 

expression

Page 97: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 97/101

Import & Export

Page 98: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 98/101

Global sheet to be

exported

This Statement will create/overwrite the

Output.xls file and will write the global

sheet in it.

Page 99: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 99/101

Page 100: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 100/101

The statement will import

the Entire XL sheet at Runtime

Page 101: Qtp Elite)

8/8/2019 Qtp Elite)

http://slidepdf.com/reader/full/qtp-elite 101/101

Runtime sheet imported from

Output.xls