Top Banner
QTP QTP
70
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 day 1

QTPQTP

Day1 Intro to QTPDay1 Intro to QTP

What is QTPFeatures of QTP ObjectsQTP EnvironmentAdd-In architectureRecording for webRun and AnalyzeQTP ComponentsObject SpyObject Repository

What is QTPWhat is QTP

QQuickuickTTest est PProfessional rofessional popularly known by its popularly known by its acronym QTP is an automation acronym QTP is an automation testing tool originally from testing tool originally from Mercury Interactive which was Mercury Interactive which was acquired by Hewlett Packard acquired by Hewlett Packard (HP) in 2006 QTP is primarily (HP) in 2006 QTP is primarily used for functional and used for functional and regression automated testing regression automated testing

What is QTP

Using QTP you can automate user actions on a web or client based computer application and test the same actions for different users different data set on various Windows operating systems andor different browsers Automation using QTP if planned and executed in a proper manner can save considerable time and money

What is QTPWhat is QTP

QTP is one of the most widely QTP is one of the most widely used automation testing tools used automation testing tools in the market today with over in the market today with over 60 market share Due to this 60 market share Due to this reason skilled QTP reason skilled QTP professionals are always in professionals are always in demanddemand

Features of QTPFeatures of QTP

1 A great set of new Quality 1 A great set of new Quality Center 1000 integration abilities Center 1000 integration abilities are there in QuickTest are there in QuickTest Professional 100 Integration Professional 100 Integration abilities such as-abilities such as-

You can maintain asset versioning You can maintain asset versioning and baselinesand baselines

There is an Asset Comparison Tool There is an Asset Comparison Tool for comparing versions of for comparing versions of individual QTP assets individual QTP assets

Features of QTPFeatures of QTP

It also includes an Asset Viewer for It also includes an Asset Viewer for viewing an earlier version of a viewing an earlier version of a QTP asset and much more such QTP asset and much more such as tool to upgrade all QuickTest as tool to upgrade all QuickTest assets to use these new features assets to use these new features etcetc

[QuickTest assets include tests [QuickTest assets include tests components application areas components application areas and the resources associated and the resources associated with them such as shared object with them such as shared object repositories function libraries repositories function libraries recovery scenarios and external recovery scenarios and external data tables]data tables]

Features of QTPFeatures of QTP

2 You can use the File gt Save 2 You can use the File gt Save Test with Resources Test with Resources command to save a command to save a standalone local copy of standalone local copy of your test with all associated your test with all associated resource files and any resource files and any called actions This perks up called actions This perks up portabilityportability

Features of QTPFeatures of QTP

3 LoadAndRunAction 3 LoadAndRunAction statement helps you load statement helps you load and run an action only when and run an action only when the step runs so that these the step runs so that these actions are not loaded each actions are not loaded each time you open a testtime you open a test

Features of QTPFeatures of QTP

4 You can centrally manage 4 You can centrally manage your work items and ToDo your work items and ToDo tasks in the To Do Pane tasks in the To Do Pane which enables you to create which enables you to create and control self-defined and control self-defined tasks and to view a tasks and to view a compiled set of the TODO compiled set of the TODO comments from your tests comments from your tests associated function libraries associated function libraries and componentsand components

Features of QTPFeatures of QTP

5 You can now develop your own 5 You can now develop your own algorithm to compare bitmap algorithm to compare bitmap checkpoints A custom checkpoints A custom comparer is an object that comparer is an object that performs the bitmap performs the bitmap comparison for the checkpoint comparison for the checkpoint according to your testing according to your testing requirements QuickTest then requirements QuickTest then receives and reports the results receives and reports the results that the custom comparer that the custom comparer returnsreturns

Features of QTPFeatures of QTP

6 There are also some improvements 6 There are also some improvements in the Test Result Analysis eg in the Test Result Analysis eg QuickTest run results can now be QuickTest run results can now be exported to MS Word and PDF exported to MS Word and PDF format use of an image file as a format use of an image file as a fourth argument to fourth argument to ReporterReportEvent method select ReporterReportEvent method select jump to Step in QuickTest when you jump to Step in QuickTest when you right click any node in test results to right click any node in test results to show that step within the QuickTest show that step within the QuickTest testing document run results for testing document run results for tests and components that are run tests and components that are run as part of a Quality Center test set as part of a Quality Center test set now include the Quality Center now include the Quality Center server and project name etcserver and project name etc

Features of QTPFeatures of QTP

7 The new Delphi Add-in enables you to test Win32 VCL Delphi 7 The new Delphi Add-in enables you to test Win32 VCL Delphi controlscontrols

8 File gt Settings gt Local System Monitor enables you to monitor the 8 File gt Settings gt Local System Monitor enables you to monitor the local (clientside) computer resources used by the application local (clientside) computer resources used by the application instance you are testing during a run sessioninstance you are testing during a run session

There are some feature enhancements also like-There are some feature enhancements also like-You can upgrade from QTP 95 to QTP 10 without uninstalling QTP 95 You can upgrade from QTP 95 to QTP 10 without uninstalling QTP 95

firstfirstIntelliSense functionality is improvedIntelliSense functionality is improvedDesign and functionality of a debugger pane is improvedDesign and functionality of a debugger pane is improvedMaintenance Run mode now includes new Object Identification Maintenance Run mode now includes new Object Identification

SolutionsSolutionsAdded Control for Editing and Managing Actions in Automation ScriptsAdded Control for Editing and Managing Actions in Automation ScriptsA new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in Extensibility and much moreAn improved Web Add-in Extensibility and much more

Features of QTPFeatures of QTP

8 File gt Settings gt Local System 8 File gt Settings gt Local System Monitor enables you to monitor Monitor enables you to monitor the local (clientside) computer the local (clientside) computer resources used by the resources used by the application instance you are application instance you are testing during a run sessiontesting during a run session

Features of QTPFeatures of QTP

There are some feature There are some feature enhancements also like-enhancements also like-

You can upgrade from QTP 95 to You can upgrade from QTP 95 to QTP 10 without uninstalling QTP QTP 10 without uninstalling QTP 95 first95 first

IntelliSense functionality is IntelliSense functionality is improvedimproved

Design and functionality of a Design and functionality of a debugger pane is improveddebugger pane is improved

Features of QTPFeatures of QTP

Maintenance Run mode now Maintenance Run mode now includes new Object Identification includes new Object Identification SolutionsSolutions

Added Control for Editing and Added Control for Editing and Managing Actions in Automation Managing Actions in Automation ScriptsScripts

A new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in An improved Web Add-in

Extensibility and much moreExtensibility and much more

Features of QTPFeatures of QTP

XPath and CSS based object XPath and CSS based object identificationidentificationGood Looking and Enhanced Results Good Looking and Enhanced Results ViewerViewerEasy Regular ExpressionsEasy Regular ExpressionsNow identify objects not only in Now identify objects not only in relation to each other but in relation to relation to each other but in relation to neighboring objectsneighboring objectsLoad Function Libraries at Run TimeLoad Function Libraries at Run TimeTest Your GUI and UI-Less Application Test Your GUI and UI-Less Application Functionality in One TestFunctionality in One TestRecord SupportRecord SupportMuch Awaited Log Tracking is available Much Awaited Log Tracking is available nownow

ObjectsObjects

Objects are GUI entities qualified Objects are GUI entities qualified with some properties data and the with some properties data and the methods necessary to operate on methods necessary to operate on that datathat dataProperty describes the object Property describes the object defined which differentiates the defined which differentiates the given object with other objectsgiven object with other objectsMethods are functions required in Methods are functions required in order to manipulate the object order to manipulate the object propertiesproperties

ObjectsObjects

Example Example A Button is said to be A Button is said to be an object which consists of an object which consists of properties such as lsquoEnabledrsquo properties such as lsquoEnabledrsquo lsquoSizersquo and methods such as lsquoSizersquo and methods such as lsquoonClickrsquo lsquoOnFocusrsquo etclsquoonClickrsquo lsquoOnFocusrsquo etc

ObjectsObjects

Properties - These are Properties - These are characteristics of the object eg characteristics of the object eg the text on a button QTP uses the text on a button QTP uses this to recognize the objectthis to recognize the object

ObjectsObjects

Methods - These are built in Methods - These are built in functionality of the object The functionality of the object The VBScript code that we write (or VBScript code that we write (or record) actually makes calls to the record) actually makes calls to the methods of an object eg methods of an object eg ReporterReportEvent() Here ReporterReportEvent() Here ReportEvent is the method of the ReportEvent is the method of the Reporter objectReporter object

ObjectsObjects

Events - These are what can Events - These are what can be done to an object This is be done to an object This is used by programmers to used by programmers to determine what an object does determine what an object does in response to an action you in response to an action you perform It is however unused perform It is however unused in QTP in QTP

ObjectsObjects

QTP Object Identification ProcessQTP Object Identification Process

Object Identification The tool determines Object Identification The tool determines what properties of objects are recordedwhat properties of objects are recorded

Object Spy Allows users to view the Object Spy Allows users to view the property of an object without recording itproperty of an object without recording it

Object Repository Holds information Object Repository Holds information recorded about each object allowing the recorded about each object allowing the test to identify the object during test to identify the object during executionexecution

ObjectsObjects

Object Smart IdentificationObject Smart Identification Smart Identification is not Artificial Smart Identification is not Artificial IntelligenceIntelligenceSI uses looseunreliable object SI uses looseunreliable object recognitionrecognitionItrsquos recommended to disable SI for Itrsquos recommended to disable SI for each and every pagewindowcontrol each and every pagewindowcontrol using the Tools-gtObject Identification using the Tools-gtObject Identification dialog (Recording)dialog (Recording)Another way to disable SI File -gt Another way to disable SI File -gt Settings -gt Run -gt Check the Disable Settings -gt Run -gt Check the Disable Smart Identification during run Smart Identification during run session check box (Run-Time)session check box (Run-Time)

QTP EnvironmentQTP Environment

Windows Windows

1048707104870710487071048707C++ Visual Basic Java NETC++ C++ Visual Basic Java NETC++ NETNET

WebWeb

1048707104870710487071048707Web Applications Web services Web Applications Web services FlashFlash

Other technologiesOther technologies

1048707104870710487071048707SAP Siebel Oracle Peoplesoft SAP Siebel Oracle Peoplesoft ActiveXActiveX

Add-In architectureAdd-In architecture

Enables QTP to provide support for Enables QTP to provide support for multiple technologiesmultiple technologiesAdd-ins are software that need to Add-ins are software that need to be installed on a system that has be installed on a system that has QTP QTP It then becomes integrated with It then becomes integrated with the QTP environmentthe QTP environment

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 2: Qtp day 1

Day1 Intro to QTPDay1 Intro to QTP

What is QTPFeatures of QTP ObjectsQTP EnvironmentAdd-In architectureRecording for webRun and AnalyzeQTP ComponentsObject SpyObject Repository

What is QTPWhat is QTP

QQuickuickTTest est PProfessional rofessional popularly known by its popularly known by its acronym QTP is an automation acronym QTP is an automation testing tool originally from testing tool originally from Mercury Interactive which was Mercury Interactive which was acquired by Hewlett Packard acquired by Hewlett Packard (HP) in 2006 QTP is primarily (HP) in 2006 QTP is primarily used for functional and used for functional and regression automated testing regression automated testing

What is QTP

Using QTP you can automate user actions on a web or client based computer application and test the same actions for different users different data set on various Windows operating systems andor different browsers Automation using QTP if planned and executed in a proper manner can save considerable time and money

What is QTPWhat is QTP

QTP is one of the most widely QTP is one of the most widely used automation testing tools used automation testing tools in the market today with over in the market today with over 60 market share Due to this 60 market share Due to this reason skilled QTP reason skilled QTP professionals are always in professionals are always in demanddemand

Features of QTPFeatures of QTP

1 A great set of new Quality 1 A great set of new Quality Center 1000 integration abilities Center 1000 integration abilities are there in QuickTest are there in QuickTest Professional 100 Integration Professional 100 Integration abilities such as-abilities such as-

You can maintain asset versioning You can maintain asset versioning and baselinesand baselines

There is an Asset Comparison Tool There is an Asset Comparison Tool for comparing versions of for comparing versions of individual QTP assets individual QTP assets

Features of QTPFeatures of QTP

It also includes an Asset Viewer for It also includes an Asset Viewer for viewing an earlier version of a viewing an earlier version of a QTP asset and much more such QTP asset and much more such as tool to upgrade all QuickTest as tool to upgrade all QuickTest assets to use these new features assets to use these new features etcetc

[QuickTest assets include tests [QuickTest assets include tests components application areas components application areas and the resources associated and the resources associated with them such as shared object with them such as shared object repositories function libraries repositories function libraries recovery scenarios and external recovery scenarios and external data tables]data tables]

Features of QTPFeatures of QTP

2 You can use the File gt Save 2 You can use the File gt Save Test with Resources Test with Resources command to save a command to save a standalone local copy of standalone local copy of your test with all associated your test with all associated resource files and any resource files and any called actions This perks up called actions This perks up portabilityportability

Features of QTPFeatures of QTP

3 LoadAndRunAction 3 LoadAndRunAction statement helps you load statement helps you load and run an action only when and run an action only when the step runs so that these the step runs so that these actions are not loaded each actions are not loaded each time you open a testtime you open a test

Features of QTPFeatures of QTP

4 You can centrally manage 4 You can centrally manage your work items and ToDo your work items and ToDo tasks in the To Do Pane tasks in the To Do Pane which enables you to create which enables you to create and control self-defined and control self-defined tasks and to view a tasks and to view a compiled set of the TODO compiled set of the TODO comments from your tests comments from your tests associated function libraries associated function libraries and componentsand components

Features of QTPFeatures of QTP

5 You can now develop your own 5 You can now develop your own algorithm to compare bitmap algorithm to compare bitmap checkpoints A custom checkpoints A custom comparer is an object that comparer is an object that performs the bitmap performs the bitmap comparison for the checkpoint comparison for the checkpoint according to your testing according to your testing requirements QuickTest then requirements QuickTest then receives and reports the results receives and reports the results that the custom comparer that the custom comparer returnsreturns

Features of QTPFeatures of QTP

6 There are also some improvements 6 There are also some improvements in the Test Result Analysis eg in the Test Result Analysis eg QuickTest run results can now be QuickTest run results can now be exported to MS Word and PDF exported to MS Word and PDF format use of an image file as a format use of an image file as a fourth argument to fourth argument to ReporterReportEvent method select ReporterReportEvent method select jump to Step in QuickTest when you jump to Step in QuickTest when you right click any node in test results to right click any node in test results to show that step within the QuickTest show that step within the QuickTest testing document run results for testing document run results for tests and components that are run tests and components that are run as part of a Quality Center test set as part of a Quality Center test set now include the Quality Center now include the Quality Center server and project name etcserver and project name etc

Features of QTPFeatures of QTP

7 The new Delphi Add-in enables you to test Win32 VCL Delphi 7 The new Delphi Add-in enables you to test Win32 VCL Delphi controlscontrols

8 File gt Settings gt Local System Monitor enables you to monitor the 8 File gt Settings gt Local System Monitor enables you to monitor the local (clientside) computer resources used by the application local (clientside) computer resources used by the application instance you are testing during a run sessioninstance you are testing during a run session

There are some feature enhancements also like-There are some feature enhancements also like-You can upgrade from QTP 95 to QTP 10 without uninstalling QTP 95 You can upgrade from QTP 95 to QTP 10 without uninstalling QTP 95

firstfirstIntelliSense functionality is improvedIntelliSense functionality is improvedDesign and functionality of a debugger pane is improvedDesign and functionality of a debugger pane is improvedMaintenance Run mode now includes new Object Identification Maintenance Run mode now includes new Object Identification

SolutionsSolutionsAdded Control for Editing and Managing Actions in Automation ScriptsAdded Control for Editing and Managing Actions in Automation ScriptsA new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in Extensibility and much moreAn improved Web Add-in Extensibility and much more

Features of QTPFeatures of QTP

8 File gt Settings gt Local System 8 File gt Settings gt Local System Monitor enables you to monitor Monitor enables you to monitor the local (clientside) computer the local (clientside) computer resources used by the resources used by the application instance you are application instance you are testing during a run sessiontesting during a run session

Features of QTPFeatures of QTP

There are some feature There are some feature enhancements also like-enhancements also like-

You can upgrade from QTP 95 to You can upgrade from QTP 95 to QTP 10 without uninstalling QTP QTP 10 without uninstalling QTP 95 first95 first

IntelliSense functionality is IntelliSense functionality is improvedimproved

Design and functionality of a Design and functionality of a debugger pane is improveddebugger pane is improved

Features of QTPFeatures of QTP

Maintenance Run mode now Maintenance Run mode now includes new Object Identification includes new Object Identification SolutionsSolutions

Added Control for Editing and Added Control for Editing and Managing Actions in Automation Managing Actions in Automation ScriptsScripts

A new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in An improved Web Add-in

Extensibility and much moreExtensibility and much more

Features of QTPFeatures of QTP

XPath and CSS based object XPath and CSS based object identificationidentificationGood Looking and Enhanced Results Good Looking and Enhanced Results ViewerViewerEasy Regular ExpressionsEasy Regular ExpressionsNow identify objects not only in Now identify objects not only in relation to each other but in relation to relation to each other but in relation to neighboring objectsneighboring objectsLoad Function Libraries at Run TimeLoad Function Libraries at Run TimeTest Your GUI and UI-Less Application Test Your GUI and UI-Less Application Functionality in One TestFunctionality in One TestRecord SupportRecord SupportMuch Awaited Log Tracking is available Much Awaited Log Tracking is available nownow

ObjectsObjects

Objects are GUI entities qualified Objects are GUI entities qualified with some properties data and the with some properties data and the methods necessary to operate on methods necessary to operate on that datathat dataProperty describes the object Property describes the object defined which differentiates the defined which differentiates the given object with other objectsgiven object with other objectsMethods are functions required in Methods are functions required in order to manipulate the object order to manipulate the object propertiesproperties

ObjectsObjects

Example Example A Button is said to be A Button is said to be an object which consists of an object which consists of properties such as lsquoEnabledrsquo properties such as lsquoEnabledrsquo lsquoSizersquo and methods such as lsquoSizersquo and methods such as lsquoonClickrsquo lsquoOnFocusrsquo etclsquoonClickrsquo lsquoOnFocusrsquo etc

ObjectsObjects

Properties - These are Properties - These are characteristics of the object eg characteristics of the object eg the text on a button QTP uses the text on a button QTP uses this to recognize the objectthis to recognize the object

ObjectsObjects

Methods - These are built in Methods - These are built in functionality of the object The functionality of the object The VBScript code that we write (or VBScript code that we write (or record) actually makes calls to the record) actually makes calls to the methods of an object eg methods of an object eg ReporterReportEvent() Here ReporterReportEvent() Here ReportEvent is the method of the ReportEvent is the method of the Reporter objectReporter object

ObjectsObjects

Events - These are what can Events - These are what can be done to an object This is be done to an object This is used by programmers to used by programmers to determine what an object does determine what an object does in response to an action you in response to an action you perform It is however unused perform It is however unused in QTP in QTP

ObjectsObjects

QTP Object Identification ProcessQTP Object Identification Process

Object Identification The tool determines Object Identification The tool determines what properties of objects are recordedwhat properties of objects are recorded

Object Spy Allows users to view the Object Spy Allows users to view the property of an object without recording itproperty of an object without recording it

Object Repository Holds information Object Repository Holds information recorded about each object allowing the recorded about each object allowing the test to identify the object during test to identify the object during executionexecution

ObjectsObjects

Object Smart IdentificationObject Smart Identification Smart Identification is not Artificial Smart Identification is not Artificial IntelligenceIntelligenceSI uses looseunreliable object SI uses looseunreliable object recognitionrecognitionItrsquos recommended to disable SI for Itrsquos recommended to disable SI for each and every pagewindowcontrol each and every pagewindowcontrol using the Tools-gtObject Identification using the Tools-gtObject Identification dialog (Recording)dialog (Recording)Another way to disable SI File -gt Another way to disable SI File -gt Settings -gt Run -gt Check the Disable Settings -gt Run -gt Check the Disable Smart Identification during run Smart Identification during run session check box (Run-Time)session check box (Run-Time)

QTP EnvironmentQTP Environment

Windows Windows

1048707104870710487071048707C++ Visual Basic Java NETC++ C++ Visual Basic Java NETC++ NETNET

WebWeb

1048707104870710487071048707Web Applications Web services Web Applications Web services FlashFlash

Other technologiesOther technologies

1048707104870710487071048707SAP Siebel Oracle Peoplesoft SAP Siebel Oracle Peoplesoft ActiveXActiveX

Add-In architectureAdd-In architecture

Enables QTP to provide support for Enables QTP to provide support for multiple technologiesmultiple technologiesAdd-ins are software that need to Add-ins are software that need to be installed on a system that has be installed on a system that has QTP QTP It then becomes integrated with It then becomes integrated with the QTP environmentthe QTP environment

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 3: Qtp day 1

What is QTPWhat is QTP

QQuickuickTTest est PProfessional rofessional popularly known by its popularly known by its acronym QTP is an automation acronym QTP is an automation testing tool originally from testing tool originally from Mercury Interactive which was Mercury Interactive which was acquired by Hewlett Packard acquired by Hewlett Packard (HP) in 2006 QTP is primarily (HP) in 2006 QTP is primarily used for functional and used for functional and regression automated testing regression automated testing

What is QTP

Using QTP you can automate user actions on a web or client based computer application and test the same actions for different users different data set on various Windows operating systems andor different browsers Automation using QTP if planned and executed in a proper manner can save considerable time and money

What is QTPWhat is QTP

QTP is one of the most widely QTP is one of the most widely used automation testing tools used automation testing tools in the market today with over in the market today with over 60 market share Due to this 60 market share Due to this reason skilled QTP reason skilled QTP professionals are always in professionals are always in demanddemand

Features of QTPFeatures of QTP

1 A great set of new Quality 1 A great set of new Quality Center 1000 integration abilities Center 1000 integration abilities are there in QuickTest are there in QuickTest Professional 100 Integration Professional 100 Integration abilities such as-abilities such as-

You can maintain asset versioning You can maintain asset versioning and baselinesand baselines

There is an Asset Comparison Tool There is an Asset Comparison Tool for comparing versions of for comparing versions of individual QTP assets individual QTP assets

Features of QTPFeatures of QTP

It also includes an Asset Viewer for It also includes an Asset Viewer for viewing an earlier version of a viewing an earlier version of a QTP asset and much more such QTP asset and much more such as tool to upgrade all QuickTest as tool to upgrade all QuickTest assets to use these new features assets to use these new features etcetc

[QuickTest assets include tests [QuickTest assets include tests components application areas components application areas and the resources associated and the resources associated with them such as shared object with them such as shared object repositories function libraries repositories function libraries recovery scenarios and external recovery scenarios and external data tables]data tables]

Features of QTPFeatures of QTP

2 You can use the File gt Save 2 You can use the File gt Save Test with Resources Test with Resources command to save a command to save a standalone local copy of standalone local copy of your test with all associated your test with all associated resource files and any resource files and any called actions This perks up called actions This perks up portabilityportability

Features of QTPFeatures of QTP

3 LoadAndRunAction 3 LoadAndRunAction statement helps you load statement helps you load and run an action only when and run an action only when the step runs so that these the step runs so that these actions are not loaded each actions are not loaded each time you open a testtime you open a test

Features of QTPFeatures of QTP

4 You can centrally manage 4 You can centrally manage your work items and ToDo your work items and ToDo tasks in the To Do Pane tasks in the To Do Pane which enables you to create which enables you to create and control self-defined and control self-defined tasks and to view a tasks and to view a compiled set of the TODO compiled set of the TODO comments from your tests comments from your tests associated function libraries associated function libraries and componentsand components

Features of QTPFeatures of QTP

5 You can now develop your own 5 You can now develop your own algorithm to compare bitmap algorithm to compare bitmap checkpoints A custom checkpoints A custom comparer is an object that comparer is an object that performs the bitmap performs the bitmap comparison for the checkpoint comparison for the checkpoint according to your testing according to your testing requirements QuickTest then requirements QuickTest then receives and reports the results receives and reports the results that the custom comparer that the custom comparer returnsreturns

Features of QTPFeatures of QTP

6 There are also some improvements 6 There are also some improvements in the Test Result Analysis eg in the Test Result Analysis eg QuickTest run results can now be QuickTest run results can now be exported to MS Word and PDF exported to MS Word and PDF format use of an image file as a format use of an image file as a fourth argument to fourth argument to ReporterReportEvent method select ReporterReportEvent method select jump to Step in QuickTest when you jump to Step in QuickTest when you right click any node in test results to right click any node in test results to show that step within the QuickTest show that step within the QuickTest testing document run results for testing document run results for tests and components that are run tests and components that are run as part of a Quality Center test set as part of a Quality Center test set now include the Quality Center now include the Quality Center server and project name etcserver and project name etc

Features of QTPFeatures of QTP

7 The new Delphi Add-in enables you to test Win32 VCL Delphi 7 The new Delphi Add-in enables you to test Win32 VCL Delphi controlscontrols

8 File gt Settings gt Local System Monitor enables you to monitor the 8 File gt Settings gt Local System Monitor enables you to monitor the local (clientside) computer resources used by the application local (clientside) computer resources used by the application instance you are testing during a run sessioninstance you are testing during a run session

There are some feature enhancements also like-There are some feature enhancements also like-You can upgrade from QTP 95 to QTP 10 without uninstalling QTP 95 You can upgrade from QTP 95 to QTP 10 without uninstalling QTP 95

firstfirstIntelliSense functionality is improvedIntelliSense functionality is improvedDesign and functionality of a debugger pane is improvedDesign and functionality of a debugger pane is improvedMaintenance Run mode now includes new Object Identification Maintenance Run mode now includes new Object Identification

SolutionsSolutionsAdded Control for Editing and Managing Actions in Automation ScriptsAdded Control for Editing and Managing Actions in Automation ScriptsA new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in Extensibility and much moreAn improved Web Add-in Extensibility and much more

Features of QTPFeatures of QTP

8 File gt Settings gt Local System 8 File gt Settings gt Local System Monitor enables you to monitor Monitor enables you to monitor the local (clientside) computer the local (clientside) computer resources used by the resources used by the application instance you are application instance you are testing during a run sessiontesting during a run session

Features of QTPFeatures of QTP

There are some feature There are some feature enhancements also like-enhancements also like-

You can upgrade from QTP 95 to You can upgrade from QTP 95 to QTP 10 without uninstalling QTP QTP 10 without uninstalling QTP 95 first95 first

IntelliSense functionality is IntelliSense functionality is improvedimproved

Design and functionality of a Design and functionality of a debugger pane is improveddebugger pane is improved

Features of QTPFeatures of QTP

Maintenance Run mode now Maintenance Run mode now includes new Object Identification includes new Object Identification SolutionsSolutions

Added Control for Editing and Added Control for Editing and Managing Actions in Automation Managing Actions in Automation ScriptsScripts

A new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in An improved Web Add-in

Extensibility and much moreExtensibility and much more

Features of QTPFeatures of QTP

XPath and CSS based object XPath and CSS based object identificationidentificationGood Looking and Enhanced Results Good Looking and Enhanced Results ViewerViewerEasy Regular ExpressionsEasy Regular ExpressionsNow identify objects not only in Now identify objects not only in relation to each other but in relation to relation to each other but in relation to neighboring objectsneighboring objectsLoad Function Libraries at Run TimeLoad Function Libraries at Run TimeTest Your GUI and UI-Less Application Test Your GUI and UI-Less Application Functionality in One TestFunctionality in One TestRecord SupportRecord SupportMuch Awaited Log Tracking is available Much Awaited Log Tracking is available nownow

ObjectsObjects

Objects are GUI entities qualified Objects are GUI entities qualified with some properties data and the with some properties data and the methods necessary to operate on methods necessary to operate on that datathat dataProperty describes the object Property describes the object defined which differentiates the defined which differentiates the given object with other objectsgiven object with other objectsMethods are functions required in Methods are functions required in order to manipulate the object order to manipulate the object propertiesproperties

ObjectsObjects

Example Example A Button is said to be A Button is said to be an object which consists of an object which consists of properties such as lsquoEnabledrsquo properties such as lsquoEnabledrsquo lsquoSizersquo and methods such as lsquoSizersquo and methods such as lsquoonClickrsquo lsquoOnFocusrsquo etclsquoonClickrsquo lsquoOnFocusrsquo etc

ObjectsObjects

Properties - These are Properties - These are characteristics of the object eg characteristics of the object eg the text on a button QTP uses the text on a button QTP uses this to recognize the objectthis to recognize the object

ObjectsObjects

Methods - These are built in Methods - These are built in functionality of the object The functionality of the object The VBScript code that we write (or VBScript code that we write (or record) actually makes calls to the record) actually makes calls to the methods of an object eg methods of an object eg ReporterReportEvent() Here ReporterReportEvent() Here ReportEvent is the method of the ReportEvent is the method of the Reporter objectReporter object

ObjectsObjects

Events - These are what can Events - These are what can be done to an object This is be done to an object This is used by programmers to used by programmers to determine what an object does determine what an object does in response to an action you in response to an action you perform It is however unused perform It is however unused in QTP in QTP

ObjectsObjects

QTP Object Identification ProcessQTP Object Identification Process

Object Identification The tool determines Object Identification The tool determines what properties of objects are recordedwhat properties of objects are recorded

Object Spy Allows users to view the Object Spy Allows users to view the property of an object without recording itproperty of an object without recording it

Object Repository Holds information Object Repository Holds information recorded about each object allowing the recorded about each object allowing the test to identify the object during test to identify the object during executionexecution

ObjectsObjects

Object Smart IdentificationObject Smart Identification Smart Identification is not Artificial Smart Identification is not Artificial IntelligenceIntelligenceSI uses looseunreliable object SI uses looseunreliable object recognitionrecognitionItrsquos recommended to disable SI for Itrsquos recommended to disable SI for each and every pagewindowcontrol each and every pagewindowcontrol using the Tools-gtObject Identification using the Tools-gtObject Identification dialog (Recording)dialog (Recording)Another way to disable SI File -gt Another way to disable SI File -gt Settings -gt Run -gt Check the Disable Settings -gt Run -gt Check the Disable Smart Identification during run Smart Identification during run session check box (Run-Time)session check box (Run-Time)

QTP EnvironmentQTP Environment

Windows Windows

1048707104870710487071048707C++ Visual Basic Java NETC++ C++ Visual Basic Java NETC++ NETNET

WebWeb

1048707104870710487071048707Web Applications Web services Web Applications Web services FlashFlash

Other technologiesOther technologies

1048707104870710487071048707SAP Siebel Oracle Peoplesoft SAP Siebel Oracle Peoplesoft ActiveXActiveX

Add-In architectureAdd-In architecture

Enables QTP to provide support for Enables QTP to provide support for multiple technologiesmultiple technologiesAdd-ins are software that need to Add-ins are software that need to be installed on a system that has be installed on a system that has QTP QTP It then becomes integrated with It then becomes integrated with the QTP environmentthe QTP environment

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 4: Qtp day 1

What is QTP

Using QTP you can automate user actions on a web or client based computer application and test the same actions for different users different data set on various Windows operating systems andor different browsers Automation using QTP if planned and executed in a proper manner can save considerable time and money

What is QTPWhat is QTP

QTP is one of the most widely QTP is one of the most widely used automation testing tools used automation testing tools in the market today with over in the market today with over 60 market share Due to this 60 market share Due to this reason skilled QTP reason skilled QTP professionals are always in professionals are always in demanddemand

Features of QTPFeatures of QTP

1 A great set of new Quality 1 A great set of new Quality Center 1000 integration abilities Center 1000 integration abilities are there in QuickTest are there in QuickTest Professional 100 Integration Professional 100 Integration abilities such as-abilities such as-

You can maintain asset versioning You can maintain asset versioning and baselinesand baselines

There is an Asset Comparison Tool There is an Asset Comparison Tool for comparing versions of for comparing versions of individual QTP assets individual QTP assets

Features of QTPFeatures of QTP

It also includes an Asset Viewer for It also includes an Asset Viewer for viewing an earlier version of a viewing an earlier version of a QTP asset and much more such QTP asset and much more such as tool to upgrade all QuickTest as tool to upgrade all QuickTest assets to use these new features assets to use these new features etcetc

[QuickTest assets include tests [QuickTest assets include tests components application areas components application areas and the resources associated and the resources associated with them such as shared object with them such as shared object repositories function libraries repositories function libraries recovery scenarios and external recovery scenarios and external data tables]data tables]

Features of QTPFeatures of QTP

2 You can use the File gt Save 2 You can use the File gt Save Test with Resources Test with Resources command to save a command to save a standalone local copy of standalone local copy of your test with all associated your test with all associated resource files and any resource files and any called actions This perks up called actions This perks up portabilityportability

Features of QTPFeatures of QTP

3 LoadAndRunAction 3 LoadAndRunAction statement helps you load statement helps you load and run an action only when and run an action only when the step runs so that these the step runs so that these actions are not loaded each actions are not loaded each time you open a testtime you open a test

Features of QTPFeatures of QTP

4 You can centrally manage 4 You can centrally manage your work items and ToDo your work items and ToDo tasks in the To Do Pane tasks in the To Do Pane which enables you to create which enables you to create and control self-defined and control self-defined tasks and to view a tasks and to view a compiled set of the TODO compiled set of the TODO comments from your tests comments from your tests associated function libraries associated function libraries and componentsand components

Features of QTPFeatures of QTP

5 You can now develop your own 5 You can now develop your own algorithm to compare bitmap algorithm to compare bitmap checkpoints A custom checkpoints A custom comparer is an object that comparer is an object that performs the bitmap performs the bitmap comparison for the checkpoint comparison for the checkpoint according to your testing according to your testing requirements QuickTest then requirements QuickTest then receives and reports the results receives and reports the results that the custom comparer that the custom comparer returnsreturns

Features of QTPFeatures of QTP

6 There are also some improvements 6 There are also some improvements in the Test Result Analysis eg in the Test Result Analysis eg QuickTest run results can now be QuickTest run results can now be exported to MS Word and PDF exported to MS Word and PDF format use of an image file as a format use of an image file as a fourth argument to fourth argument to ReporterReportEvent method select ReporterReportEvent method select jump to Step in QuickTest when you jump to Step in QuickTest when you right click any node in test results to right click any node in test results to show that step within the QuickTest show that step within the QuickTest testing document run results for testing document run results for tests and components that are run tests and components that are run as part of a Quality Center test set as part of a Quality Center test set now include the Quality Center now include the Quality Center server and project name etcserver and project name etc

Features of QTPFeatures of QTP

7 The new Delphi Add-in enables you to test Win32 VCL Delphi 7 The new Delphi Add-in enables you to test Win32 VCL Delphi controlscontrols

8 File gt Settings gt Local System Monitor enables you to monitor the 8 File gt Settings gt Local System Monitor enables you to monitor the local (clientside) computer resources used by the application local (clientside) computer resources used by the application instance you are testing during a run sessioninstance you are testing during a run session

There are some feature enhancements also like-There are some feature enhancements also like-You can upgrade from QTP 95 to QTP 10 without uninstalling QTP 95 You can upgrade from QTP 95 to QTP 10 without uninstalling QTP 95

firstfirstIntelliSense functionality is improvedIntelliSense functionality is improvedDesign and functionality of a debugger pane is improvedDesign and functionality of a debugger pane is improvedMaintenance Run mode now includes new Object Identification Maintenance Run mode now includes new Object Identification

SolutionsSolutionsAdded Control for Editing and Managing Actions in Automation ScriptsAdded Control for Editing and Managing Actions in Automation ScriptsA new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in Extensibility and much moreAn improved Web Add-in Extensibility and much more

Features of QTPFeatures of QTP

8 File gt Settings gt Local System 8 File gt Settings gt Local System Monitor enables you to monitor Monitor enables you to monitor the local (clientside) computer the local (clientside) computer resources used by the resources used by the application instance you are application instance you are testing during a run sessiontesting during a run session

Features of QTPFeatures of QTP

There are some feature There are some feature enhancements also like-enhancements also like-

You can upgrade from QTP 95 to You can upgrade from QTP 95 to QTP 10 without uninstalling QTP QTP 10 without uninstalling QTP 95 first95 first

IntelliSense functionality is IntelliSense functionality is improvedimproved

Design and functionality of a Design and functionality of a debugger pane is improveddebugger pane is improved

Features of QTPFeatures of QTP

Maintenance Run mode now Maintenance Run mode now includes new Object Identification includes new Object Identification SolutionsSolutions

Added Control for Editing and Added Control for Editing and Managing Actions in Automation Managing Actions in Automation ScriptsScripts

A new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in An improved Web Add-in

Extensibility and much moreExtensibility and much more

Features of QTPFeatures of QTP

XPath and CSS based object XPath and CSS based object identificationidentificationGood Looking and Enhanced Results Good Looking and Enhanced Results ViewerViewerEasy Regular ExpressionsEasy Regular ExpressionsNow identify objects not only in Now identify objects not only in relation to each other but in relation to relation to each other but in relation to neighboring objectsneighboring objectsLoad Function Libraries at Run TimeLoad Function Libraries at Run TimeTest Your GUI and UI-Less Application Test Your GUI and UI-Less Application Functionality in One TestFunctionality in One TestRecord SupportRecord SupportMuch Awaited Log Tracking is available Much Awaited Log Tracking is available nownow

ObjectsObjects

Objects are GUI entities qualified Objects are GUI entities qualified with some properties data and the with some properties data and the methods necessary to operate on methods necessary to operate on that datathat dataProperty describes the object Property describes the object defined which differentiates the defined which differentiates the given object with other objectsgiven object with other objectsMethods are functions required in Methods are functions required in order to manipulate the object order to manipulate the object propertiesproperties

ObjectsObjects

Example Example A Button is said to be A Button is said to be an object which consists of an object which consists of properties such as lsquoEnabledrsquo properties such as lsquoEnabledrsquo lsquoSizersquo and methods such as lsquoSizersquo and methods such as lsquoonClickrsquo lsquoOnFocusrsquo etclsquoonClickrsquo lsquoOnFocusrsquo etc

ObjectsObjects

Properties - These are Properties - These are characteristics of the object eg characteristics of the object eg the text on a button QTP uses the text on a button QTP uses this to recognize the objectthis to recognize the object

ObjectsObjects

Methods - These are built in Methods - These are built in functionality of the object The functionality of the object The VBScript code that we write (or VBScript code that we write (or record) actually makes calls to the record) actually makes calls to the methods of an object eg methods of an object eg ReporterReportEvent() Here ReporterReportEvent() Here ReportEvent is the method of the ReportEvent is the method of the Reporter objectReporter object

ObjectsObjects

Events - These are what can Events - These are what can be done to an object This is be done to an object This is used by programmers to used by programmers to determine what an object does determine what an object does in response to an action you in response to an action you perform It is however unused perform It is however unused in QTP in QTP

ObjectsObjects

QTP Object Identification ProcessQTP Object Identification Process

Object Identification The tool determines Object Identification The tool determines what properties of objects are recordedwhat properties of objects are recorded

Object Spy Allows users to view the Object Spy Allows users to view the property of an object without recording itproperty of an object without recording it

Object Repository Holds information Object Repository Holds information recorded about each object allowing the recorded about each object allowing the test to identify the object during test to identify the object during executionexecution

ObjectsObjects

Object Smart IdentificationObject Smart Identification Smart Identification is not Artificial Smart Identification is not Artificial IntelligenceIntelligenceSI uses looseunreliable object SI uses looseunreliable object recognitionrecognitionItrsquos recommended to disable SI for Itrsquos recommended to disable SI for each and every pagewindowcontrol each and every pagewindowcontrol using the Tools-gtObject Identification using the Tools-gtObject Identification dialog (Recording)dialog (Recording)Another way to disable SI File -gt Another way to disable SI File -gt Settings -gt Run -gt Check the Disable Settings -gt Run -gt Check the Disable Smart Identification during run Smart Identification during run session check box (Run-Time)session check box (Run-Time)

QTP EnvironmentQTP Environment

Windows Windows

1048707104870710487071048707C++ Visual Basic Java NETC++ C++ Visual Basic Java NETC++ NETNET

WebWeb

1048707104870710487071048707Web Applications Web services Web Applications Web services FlashFlash

Other technologiesOther technologies

1048707104870710487071048707SAP Siebel Oracle Peoplesoft SAP Siebel Oracle Peoplesoft ActiveXActiveX

Add-In architectureAdd-In architecture

Enables QTP to provide support for Enables QTP to provide support for multiple technologiesmultiple technologiesAdd-ins are software that need to Add-ins are software that need to be installed on a system that has be installed on a system that has QTP QTP It then becomes integrated with It then becomes integrated with the QTP environmentthe QTP environment

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 5: Qtp day 1

What is QTPWhat is QTP

QTP is one of the most widely QTP is one of the most widely used automation testing tools used automation testing tools in the market today with over in the market today with over 60 market share Due to this 60 market share Due to this reason skilled QTP reason skilled QTP professionals are always in professionals are always in demanddemand

Features of QTPFeatures of QTP

1 A great set of new Quality 1 A great set of new Quality Center 1000 integration abilities Center 1000 integration abilities are there in QuickTest are there in QuickTest Professional 100 Integration Professional 100 Integration abilities such as-abilities such as-

You can maintain asset versioning You can maintain asset versioning and baselinesand baselines

There is an Asset Comparison Tool There is an Asset Comparison Tool for comparing versions of for comparing versions of individual QTP assets individual QTP assets

Features of QTPFeatures of QTP

It also includes an Asset Viewer for It also includes an Asset Viewer for viewing an earlier version of a viewing an earlier version of a QTP asset and much more such QTP asset and much more such as tool to upgrade all QuickTest as tool to upgrade all QuickTest assets to use these new features assets to use these new features etcetc

[QuickTest assets include tests [QuickTest assets include tests components application areas components application areas and the resources associated and the resources associated with them such as shared object with them such as shared object repositories function libraries repositories function libraries recovery scenarios and external recovery scenarios and external data tables]data tables]

Features of QTPFeatures of QTP

2 You can use the File gt Save 2 You can use the File gt Save Test with Resources Test with Resources command to save a command to save a standalone local copy of standalone local copy of your test with all associated your test with all associated resource files and any resource files and any called actions This perks up called actions This perks up portabilityportability

Features of QTPFeatures of QTP

3 LoadAndRunAction 3 LoadAndRunAction statement helps you load statement helps you load and run an action only when and run an action only when the step runs so that these the step runs so that these actions are not loaded each actions are not loaded each time you open a testtime you open a test

Features of QTPFeatures of QTP

4 You can centrally manage 4 You can centrally manage your work items and ToDo your work items and ToDo tasks in the To Do Pane tasks in the To Do Pane which enables you to create which enables you to create and control self-defined and control self-defined tasks and to view a tasks and to view a compiled set of the TODO compiled set of the TODO comments from your tests comments from your tests associated function libraries associated function libraries and componentsand components

Features of QTPFeatures of QTP

5 You can now develop your own 5 You can now develop your own algorithm to compare bitmap algorithm to compare bitmap checkpoints A custom checkpoints A custom comparer is an object that comparer is an object that performs the bitmap performs the bitmap comparison for the checkpoint comparison for the checkpoint according to your testing according to your testing requirements QuickTest then requirements QuickTest then receives and reports the results receives and reports the results that the custom comparer that the custom comparer returnsreturns

Features of QTPFeatures of QTP

6 There are also some improvements 6 There are also some improvements in the Test Result Analysis eg in the Test Result Analysis eg QuickTest run results can now be QuickTest run results can now be exported to MS Word and PDF exported to MS Word and PDF format use of an image file as a format use of an image file as a fourth argument to fourth argument to ReporterReportEvent method select ReporterReportEvent method select jump to Step in QuickTest when you jump to Step in QuickTest when you right click any node in test results to right click any node in test results to show that step within the QuickTest show that step within the QuickTest testing document run results for testing document run results for tests and components that are run tests and components that are run as part of a Quality Center test set as part of a Quality Center test set now include the Quality Center now include the Quality Center server and project name etcserver and project name etc

Features of QTPFeatures of QTP

7 The new Delphi Add-in enables you to test Win32 VCL Delphi 7 The new Delphi Add-in enables you to test Win32 VCL Delphi controlscontrols

8 File gt Settings gt Local System Monitor enables you to monitor the 8 File gt Settings gt Local System Monitor enables you to monitor the local (clientside) computer resources used by the application local (clientside) computer resources used by the application instance you are testing during a run sessioninstance you are testing during a run session

There are some feature enhancements also like-There are some feature enhancements also like-You can upgrade from QTP 95 to QTP 10 without uninstalling QTP 95 You can upgrade from QTP 95 to QTP 10 without uninstalling QTP 95

firstfirstIntelliSense functionality is improvedIntelliSense functionality is improvedDesign and functionality of a debugger pane is improvedDesign and functionality of a debugger pane is improvedMaintenance Run mode now includes new Object Identification Maintenance Run mode now includes new Object Identification

SolutionsSolutionsAdded Control for Editing and Managing Actions in Automation ScriptsAdded Control for Editing and Managing Actions in Automation ScriptsA new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in Extensibility and much moreAn improved Web Add-in Extensibility and much more

Features of QTPFeatures of QTP

8 File gt Settings gt Local System 8 File gt Settings gt Local System Monitor enables you to monitor Monitor enables you to monitor the local (clientside) computer the local (clientside) computer resources used by the resources used by the application instance you are application instance you are testing during a run sessiontesting during a run session

Features of QTPFeatures of QTP

There are some feature There are some feature enhancements also like-enhancements also like-

You can upgrade from QTP 95 to You can upgrade from QTP 95 to QTP 10 without uninstalling QTP QTP 10 without uninstalling QTP 95 first95 first

IntelliSense functionality is IntelliSense functionality is improvedimproved

Design and functionality of a Design and functionality of a debugger pane is improveddebugger pane is improved

Features of QTPFeatures of QTP

Maintenance Run mode now Maintenance Run mode now includes new Object Identification includes new Object Identification SolutionsSolutions

Added Control for Editing and Added Control for Editing and Managing Actions in Automation Managing Actions in Automation ScriptsScripts

A new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in An improved Web Add-in

Extensibility and much moreExtensibility and much more

Features of QTPFeatures of QTP

XPath and CSS based object XPath and CSS based object identificationidentificationGood Looking and Enhanced Results Good Looking and Enhanced Results ViewerViewerEasy Regular ExpressionsEasy Regular ExpressionsNow identify objects not only in Now identify objects not only in relation to each other but in relation to relation to each other but in relation to neighboring objectsneighboring objectsLoad Function Libraries at Run TimeLoad Function Libraries at Run TimeTest Your GUI and UI-Less Application Test Your GUI and UI-Less Application Functionality in One TestFunctionality in One TestRecord SupportRecord SupportMuch Awaited Log Tracking is available Much Awaited Log Tracking is available nownow

ObjectsObjects

Objects are GUI entities qualified Objects are GUI entities qualified with some properties data and the with some properties data and the methods necessary to operate on methods necessary to operate on that datathat dataProperty describes the object Property describes the object defined which differentiates the defined which differentiates the given object with other objectsgiven object with other objectsMethods are functions required in Methods are functions required in order to manipulate the object order to manipulate the object propertiesproperties

ObjectsObjects

Example Example A Button is said to be A Button is said to be an object which consists of an object which consists of properties such as lsquoEnabledrsquo properties such as lsquoEnabledrsquo lsquoSizersquo and methods such as lsquoSizersquo and methods such as lsquoonClickrsquo lsquoOnFocusrsquo etclsquoonClickrsquo lsquoOnFocusrsquo etc

ObjectsObjects

Properties - These are Properties - These are characteristics of the object eg characteristics of the object eg the text on a button QTP uses the text on a button QTP uses this to recognize the objectthis to recognize the object

ObjectsObjects

Methods - These are built in Methods - These are built in functionality of the object The functionality of the object The VBScript code that we write (or VBScript code that we write (or record) actually makes calls to the record) actually makes calls to the methods of an object eg methods of an object eg ReporterReportEvent() Here ReporterReportEvent() Here ReportEvent is the method of the ReportEvent is the method of the Reporter objectReporter object

ObjectsObjects

Events - These are what can Events - These are what can be done to an object This is be done to an object This is used by programmers to used by programmers to determine what an object does determine what an object does in response to an action you in response to an action you perform It is however unused perform It is however unused in QTP in QTP

ObjectsObjects

QTP Object Identification ProcessQTP Object Identification Process

Object Identification The tool determines Object Identification The tool determines what properties of objects are recordedwhat properties of objects are recorded

Object Spy Allows users to view the Object Spy Allows users to view the property of an object without recording itproperty of an object without recording it

Object Repository Holds information Object Repository Holds information recorded about each object allowing the recorded about each object allowing the test to identify the object during test to identify the object during executionexecution

ObjectsObjects

Object Smart IdentificationObject Smart Identification Smart Identification is not Artificial Smart Identification is not Artificial IntelligenceIntelligenceSI uses looseunreliable object SI uses looseunreliable object recognitionrecognitionItrsquos recommended to disable SI for Itrsquos recommended to disable SI for each and every pagewindowcontrol each and every pagewindowcontrol using the Tools-gtObject Identification using the Tools-gtObject Identification dialog (Recording)dialog (Recording)Another way to disable SI File -gt Another way to disable SI File -gt Settings -gt Run -gt Check the Disable Settings -gt Run -gt Check the Disable Smart Identification during run Smart Identification during run session check box (Run-Time)session check box (Run-Time)

QTP EnvironmentQTP Environment

Windows Windows

1048707104870710487071048707C++ Visual Basic Java NETC++ C++ Visual Basic Java NETC++ NETNET

WebWeb

1048707104870710487071048707Web Applications Web services Web Applications Web services FlashFlash

Other technologiesOther technologies

1048707104870710487071048707SAP Siebel Oracle Peoplesoft SAP Siebel Oracle Peoplesoft ActiveXActiveX

Add-In architectureAdd-In architecture

Enables QTP to provide support for Enables QTP to provide support for multiple technologiesmultiple technologiesAdd-ins are software that need to Add-ins are software that need to be installed on a system that has be installed on a system that has QTP QTP It then becomes integrated with It then becomes integrated with the QTP environmentthe QTP environment

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 6: Qtp day 1

Features of QTPFeatures of QTP

1 A great set of new Quality 1 A great set of new Quality Center 1000 integration abilities Center 1000 integration abilities are there in QuickTest are there in QuickTest Professional 100 Integration Professional 100 Integration abilities such as-abilities such as-

You can maintain asset versioning You can maintain asset versioning and baselinesand baselines

There is an Asset Comparison Tool There is an Asset Comparison Tool for comparing versions of for comparing versions of individual QTP assets individual QTP assets

Features of QTPFeatures of QTP

It also includes an Asset Viewer for It also includes an Asset Viewer for viewing an earlier version of a viewing an earlier version of a QTP asset and much more such QTP asset and much more such as tool to upgrade all QuickTest as tool to upgrade all QuickTest assets to use these new features assets to use these new features etcetc

[QuickTest assets include tests [QuickTest assets include tests components application areas components application areas and the resources associated and the resources associated with them such as shared object with them such as shared object repositories function libraries repositories function libraries recovery scenarios and external recovery scenarios and external data tables]data tables]

Features of QTPFeatures of QTP

2 You can use the File gt Save 2 You can use the File gt Save Test with Resources Test with Resources command to save a command to save a standalone local copy of standalone local copy of your test with all associated your test with all associated resource files and any resource files and any called actions This perks up called actions This perks up portabilityportability

Features of QTPFeatures of QTP

3 LoadAndRunAction 3 LoadAndRunAction statement helps you load statement helps you load and run an action only when and run an action only when the step runs so that these the step runs so that these actions are not loaded each actions are not loaded each time you open a testtime you open a test

Features of QTPFeatures of QTP

4 You can centrally manage 4 You can centrally manage your work items and ToDo your work items and ToDo tasks in the To Do Pane tasks in the To Do Pane which enables you to create which enables you to create and control self-defined and control self-defined tasks and to view a tasks and to view a compiled set of the TODO compiled set of the TODO comments from your tests comments from your tests associated function libraries associated function libraries and componentsand components

Features of QTPFeatures of QTP

5 You can now develop your own 5 You can now develop your own algorithm to compare bitmap algorithm to compare bitmap checkpoints A custom checkpoints A custom comparer is an object that comparer is an object that performs the bitmap performs the bitmap comparison for the checkpoint comparison for the checkpoint according to your testing according to your testing requirements QuickTest then requirements QuickTest then receives and reports the results receives and reports the results that the custom comparer that the custom comparer returnsreturns

Features of QTPFeatures of QTP

6 There are also some improvements 6 There are also some improvements in the Test Result Analysis eg in the Test Result Analysis eg QuickTest run results can now be QuickTest run results can now be exported to MS Word and PDF exported to MS Word and PDF format use of an image file as a format use of an image file as a fourth argument to fourth argument to ReporterReportEvent method select ReporterReportEvent method select jump to Step in QuickTest when you jump to Step in QuickTest when you right click any node in test results to right click any node in test results to show that step within the QuickTest show that step within the QuickTest testing document run results for testing document run results for tests and components that are run tests and components that are run as part of a Quality Center test set as part of a Quality Center test set now include the Quality Center now include the Quality Center server and project name etcserver and project name etc

Features of QTPFeatures of QTP

7 The new Delphi Add-in enables you to test Win32 VCL Delphi 7 The new Delphi Add-in enables you to test Win32 VCL Delphi controlscontrols

8 File gt Settings gt Local System Monitor enables you to monitor the 8 File gt Settings gt Local System Monitor enables you to monitor the local (clientside) computer resources used by the application local (clientside) computer resources used by the application instance you are testing during a run sessioninstance you are testing during a run session

There are some feature enhancements also like-There are some feature enhancements also like-You can upgrade from QTP 95 to QTP 10 without uninstalling QTP 95 You can upgrade from QTP 95 to QTP 10 without uninstalling QTP 95

firstfirstIntelliSense functionality is improvedIntelliSense functionality is improvedDesign and functionality of a debugger pane is improvedDesign and functionality of a debugger pane is improvedMaintenance Run mode now includes new Object Identification Maintenance Run mode now includes new Object Identification

SolutionsSolutionsAdded Control for Editing and Managing Actions in Automation ScriptsAdded Control for Editing and Managing Actions in Automation ScriptsA new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in Extensibility and much moreAn improved Web Add-in Extensibility and much more

Features of QTPFeatures of QTP

8 File gt Settings gt Local System 8 File gt Settings gt Local System Monitor enables you to monitor Monitor enables you to monitor the local (clientside) computer the local (clientside) computer resources used by the resources used by the application instance you are application instance you are testing during a run sessiontesting during a run session

Features of QTPFeatures of QTP

There are some feature There are some feature enhancements also like-enhancements also like-

You can upgrade from QTP 95 to You can upgrade from QTP 95 to QTP 10 without uninstalling QTP QTP 10 without uninstalling QTP 95 first95 first

IntelliSense functionality is IntelliSense functionality is improvedimproved

Design and functionality of a Design and functionality of a debugger pane is improveddebugger pane is improved

Features of QTPFeatures of QTP

Maintenance Run mode now Maintenance Run mode now includes new Object Identification includes new Object Identification SolutionsSolutions

Added Control for Editing and Added Control for Editing and Managing Actions in Automation Managing Actions in Automation ScriptsScripts

A new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in An improved Web Add-in

Extensibility and much moreExtensibility and much more

Features of QTPFeatures of QTP

XPath and CSS based object XPath and CSS based object identificationidentificationGood Looking and Enhanced Results Good Looking and Enhanced Results ViewerViewerEasy Regular ExpressionsEasy Regular ExpressionsNow identify objects not only in Now identify objects not only in relation to each other but in relation to relation to each other but in relation to neighboring objectsneighboring objectsLoad Function Libraries at Run TimeLoad Function Libraries at Run TimeTest Your GUI and UI-Less Application Test Your GUI and UI-Less Application Functionality in One TestFunctionality in One TestRecord SupportRecord SupportMuch Awaited Log Tracking is available Much Awaited Log Tracking is available nownow

ObjectsObjects

Objects are GUI entities qualified Objects are GUI entities qualified with some properties data and the with some properties data and the methods necessary to operate on methods necessary to operate on that datathat dataProperty describes the object Property describes the object defined which differentiates the defined which differentiates the given object with other objectsgiven object with other objectsMethods are functions required in Methods are functions required in order to manipulate the object order to manipulate the object propertiesproperties

ObjectsObjects

Example Example A Button is said to be A Button is said to be an object which consists of an object which consists of properties such as lsquoEnabledrsquo properties such as lsquoEnabledrsquo lsquoSizersquo and methods such as lsquoSizersquo and methods such as lsquoonClickrsquo lsquoOnFocusrsquo etclsquoonClickrsquo lsquoOnFocusrsquo etc

ObjectsObjects

Properties - These are Properties - These are characteristics of the object eg characteristics of the object eg the text on a button QTP uses the text on a button QTP uses this to recognize the objectthis to recognize the object

ObjectsObjects

Methods - These are built in Methods - These are built in functionality of the object The functionality of the object The VBScript code that we write (or VBScript code that we write (or record) actually makes calls to the record) actually makes calls to the methods of an object eg methods of an object eg ReporterReportEvent() Here ReporterReportEvent() Here ReportEvent is the method of the ReportEvent is the method of the Reporter objectReporter object

ObjectsObjects

Events - These are what can Events - These are what can be done to an object This is be done to an object This is used by programmers to used by programmers to determine what an object does determine what an object does in response to an action you in response to an action you perform It is however unused perform It is however unused in QTP in QTP

ObjectsObjects

QTP Object Identification ProcessQTP Object Identification Process

Object Identification The tool determines Object Identification The tool determines what properties of objects are recordedwhat properties of objects are recorded

Object Spy Allows users to view the Object Spy Allows users to view the property of an object without recording itproperty of an object without recording it

Object Repository Holds information Object Repository Holds information recorded about each object allowing the recorded about each object allowing the test to identify the object during test to identify the object during executionexecution

ObjectsObjects

Object Smart IdentificationObject Smart Identification Smart Identification is not Artificial Smart Identification is not Artificial IntelligenceIntelligenceSI uses looseunreliable object SI uses looseunreliable object recognitionrecognitionItrsquos recommended to disable SI for Itrsquos recommended to disable SI for each and every pagewindowcontrol each and every pagewindowcontrol using the Tools-gtObject Identification using the Tools-gtObject Identification dialog (Recording)dialog (Recording)Another way to disable SI File -gt Another way to disable SI File -gt Settings -gt Run -gt Check the Disable Settings -gt Run -gt Check the Disable Smart Identification during run Smart Identification during run session check box (Run-Time)session check box (Run-Time)

QTP EnvironmentQTP Environment

Windows Windows

1048707104870710487071048707C++ Visual Basic Java NETC++ C++ Visual Basic Java NETC++ NETNET

WebWeb

1048707104870710487071048707Web Applications Web services Web Applications Web services FlashFlash

Other technologiesOther technologies

1048707104870710487071048707SAP Siebel Oracle Peoplesoft SAP Siebel Oracle Peoplesoft ActiveXActiveX

Add-In architectureAdd-In architecture

Enables QTP to provide support for Enables QTP to provide support for multiple technologiesmultiple technologiesAdd-ins are software that need to Add-ins are software that need to be installed on a system that has be installed on a system that has QTP QTP It then becomes integrated with It then becomes integrated with the QTP environmentthe QTP environment

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 7: Qtp day 1

Features of QTPFeatures of QTP

It also includes an Asset Viewer for It also includes an Asset Viewer for viewing an earlier version of a viewing an earlier version of a QTP asset and much more such QTP asset and much more such as tool to upgrade all QuickTest as tool to upgrade all QuickTest assets to use these new features assets to use these new features etcetc

[QuickTest assets include tests [QuickTest assets include tests components application areas components application areas and the resources associated and the resources associated with them such as shared object with them such as shared object repositories function libraries repositories function libraries recovery scenarios and external recovery scenarios and external data tables]data tables]

Features of QTPFeatures of QTP

2 You can use the File gt Save 2 You can use the File gt Save Test with Resources Test with Resources command to save a command to save a standalone local copy of standalone local copy of your test with all associated your test with all associated resource files and any resource files and any called actions This perks up called actions This perks up portabilityportability

Features of QTPFeatures of QTP

3 LoadAndRunAction 3 LoadAndRunAction statement helps you load statement helps you load and run an action only when and run an action only when the step runs so that these the step runs so that these actions are not loaded each actions are not loaded each time you open a testtime you open a test

Features of QTPFeatures of QTP

4 You can centrally manage 4 You can centrally manage your work items and ToDo your work items and ToDo tasks in the To Do Pane tasks in the To Do Pane which enables you to create which enables you to create and control self-defined and control self-defined tasks and to view a tasks and to view a compiled set of the TODO compiled set of the TODO comments from your tests comments from your tests associated function libraries associated function libraries and componentsand components

Features of QTPFeatures of QTP

5 You can now develop your own 5 You can now develop your own algorithm to compare bitmap algorithm to compare bitmap checkpoints A custom checkpoints A custom comparer is an object that comparer is an object that performs the bitmap performs the bitmap comparison for the checkpoint comparison for the checkpoint according to your testing according to your testing requirements QuickTest then requirements QuickTest then receives and reports the results receives and reports the results that the custom comparer that the custom comparer returnsreturns

Features of QTPFeatures of QTP

6 There are also some improvements 6 There are also some improvements in the Test Result Analysis eg in the Test Result Analysis eg QuickTest run results can now be QuickTest run results can now be exported to MS Word and PDF exported to MS Word and PDF format use of an image file as a format use of an image file as a fourth argument to fourth argument to ReporterReportEvent method select ReporterReportEvent method select jump to Step in QuickTest when you jump to Step in QuickTest when you right click any node in test results to right click any node in test results to show that step within the QuickTest show that step within the QuickTest testing document run results for testing document run results for tests and components that are run tests and components that are run as part of a Quality Center test set as part of a Quality Center test set now include the Quality Center now include the Quality Center server and project name etcserver and project name etc

Features of QTPFeatures of QTP

7 The new Delphi Add-in enables you to test Win32 VCL Delphi 7 The new Delphi Add-in enables you to test Win32 VCL Delphi controlscontrols

8 File gt Settings gt Local System Monitor enables you to monitor the 8 File gt Settings gt Local System Monitor enables you to monitor the local (clientside) computer resources used by the application local (clientside) computer resources used by the application instance you are testing during a run sessioninstance you are testing during a run session

There are some feature enhancements also like-There are some feature enhancements also like-You can upgrade from QTP 95 to QTP 10 without uninstalling QTP 95 You can upgrade from QTP 95 to QTP 10 without uninstalling QTP 95

firstfirstIntelliSense functionality is improvedIntelliSense functionality is improvedDesign and functionality of a debugger pane is improvedDesign and functionality of a debugger pane is improvedMaintenance Run mode now includes new Object Identification Maintenance Run mode now includes new Object Identification

SolutionsSolutionsAdded Control for Editing and Managing Actions in Automation ScriptsAdded Control for Editing and Managing Actions in Automation ScriptsA new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in Extensibility and much moreAn improved Web Add-in Extensibility and much more

Features of QTPFeatures of QTP

8 File gt Settings gt Local System 8 File gt Settings gt Local System Monitor enables you to monitor Monitor enables you to monitor the local (clientside) computer the local (clientside) computer resources used by the resources used by the application instance you are application instance you are testing during a run sessiontesting during a run session

Features of QTPFeatures of QTP

There are some feature There are some feature enhancements also like-enhancements also like-

You can upgrade from QTP 95 to You can upgrade from QTP 95 to QTP 10 without uninstalling QTP QTP 10 without uninstalling QTP 95 first95 first

IntelliSense functionality is IntelliSense functionality is improvedimproved

Design and functionality of a Design and functionality of a debugger pane is improveddebugger pane is improved

Features of QTPFeatures of QTP

Maintenance Run mode now Maintenance Run mode now includes new Object Identification includes new Object Identification SolutionsSolutions

Added Control for Editing and Added Control for Editing and Managing Actions in Automation Managing Actions in Automation ScriptsScripts

A new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in An improved Web Add-in

Extensibility and much moreExtensibility and much more

Features of QTPFeatures of QTP

XPath and CSS based object XPath and CSS based object identificationidentificationGood Looking and Enhanced Results Good Looking and Enhanced Results ViewerViewerEasy Regular ExpressionsEasy Regular ExpressionsNow identify objects not only in Now identify objects not only in relation to each other but in relation to relation to each other but in relation to neighboring objectsneighboring objectsLoad Function Libraries at Run TimeLoad Function Libraries at Run TimeTest Your GUI and UI-Less Application Test Your GUI and UI-Less Application Functionality in One TestFunctionality in One TestRecord SupportRecord SupportMuch Awaited Log Tracking is available Much Awaited Log Tracking is available nownow

ObjectsObjects

Objects are GUI entities qualified Objects are GUI entities qualified with some properties data and the with some properties data and the methods necessary to operate on methods necessary to operate on that datathat dataProperty describes the object Property describes the object defined which differentiates the defined which differentiates the given object with other objectsgiven object with other objectsMethods are functions required in Methods are functions required in order to manipulate the object order to manipulate the object propertiesproperties

ObjectsObjects

Example Example A Button is said to be A Button is said to be an object which consists of an object which consists of properties such as lsquoEnabledrsquo properties such as lsquoEnabledrsquo lsquoSizersquo and methods such as lsquoSizersquo and methods such as lsquoonClickrsquo lsquoOnFocusrsquo etclsquoonClickrsquo lsquoOnFocusrsquo etc

ObjectsObjects

Properties - These are Properties - These are characteristics of the object eg characteristics of the object eg the text on a button QTP uses the text on a button QTP uses this to recognize the objectthis to recognize the object

ObjectsObjects

Methods - These are built in Methods - These are built in functionality of the object The functionality of the object The VBScript code that we write (or VBScript code that we write (or record) actually makes calls to the record) actually makes calls to the methods of an object eg methods of an object eg ReporterReportEvent() Here ReporterReportEvent() Here ReportEvent is the method of the ReportEvent is the method of the Reporter objectReporter object

ObjectsObjects

Events - These are what can Events - These are what can be done to an object This is be done to an object This is used by programmers to used by programmers to determine what an object does determine what an object does in response to an action you in response to an action you perform It is however unused perform It is however unused in QTP in QTP

ObjectsObjects

QTP Object Identification ProcessQTP Object Identification Process

Object Identification The tool determines Object Identification The tool determines what properties of objects are recordedwhat properties of objects are recorded

Object Spy Allows users to view the Object Spy Allows users to view the property of an object without recording itproperty of an object without recording it

Object Repository Holds information Object Repository Holds information recorded about each object allowing the recorded about each object allowing the test to identify the object during test to identify the object during executionexecution

ObjectsObjects

Object Smart IdentificationObject Smart Identification Smart Identification is not Artificial Smart Identification is not Artificial IntelligenceIntelligenceSI uses looseunreliable object SI uses looseunreliable object recognitionrecognitionItrsquos recommended to disable SI for Itrsquos recommended to disable SI for each and every pagewindowcontrol each and every pagewindowcontrol using the Tools-gtObject Identification using the Tools-gtObject Identification dialog (Recording)dialog (Recording)Another way to disable SI File -gt Another way to disable SI File -gt Settings -gt Run -gt Check the Disable Settings -gt Run -gt Check the Disable Smart Identification during run Smart Identification during run session check box (Run-Time)session check box (Run-Time)

QTP EnvironmentQTP Environment

Windows Windows

1048707104870710487071048707C++ Visual Basic Java NETC++ C++ Visual Basic Java NETC++ NETNET

WebWeb

1048707104870710487071048707Web Applications Web services Web Applications Web services FlashFlash

Other technologiesOther technologies

1048707104870710487071048707SAP Siebel Oracle Peoplesoft SAP Siebel Oracle Peoplesoft ActiveXActiveX

Add-In architectureAdd-In architecture

Enables QTP to provide support for Enables QTP to provide support for multiple technologiesmultiple technologiesAdd-ins are software that need to Add-ins are software that need to be installed on a system that has be installed on a system that has QTP QTP It then becomes integrated with It then becomes integrated with the QTP environmentthe QTP environment

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 8: Qtp day 1

Features of QTPFeatures of QTP

2 You can use the File gt Save 2 You can use the File gt Save Test with Resources Test with Resources command to save a command to save a standalone local copy of standalone local copy of your test with all associated your test with all associated resource files and any resource files and any called actions This perks up called actions This perks up portabilityportability

Features of QTPFeatures of QTP

3 LoadAndRunAction 3 LoadAndRunAction statement helps you load statement helps you load and run an action only when and run an action only when the step runs so that these the step runs so that these actions are not loaded each actions are not loaded each time you open a testtime you open a test

Features of QTPFeatures of QTP

4 You can centrally manage 4 You can centrally manage your work items and ToDo your work items and ToDo tasks in the To Do Pane tasks in the To Do Pane which enables you to create which enables you to create and control self-defined and control self-defined tasks and to view a tasks and to view a compiled set of the TODO compiled set of the TODO comments from your tests comments from your tests associated function libraries associated function libraries and componentsand components

Features of QTPFeatures of QTP

5 You can now develop your own 5 You can now develop your own algorithm to compare bitmap algorithm to compare bitmap checkpoints A custom checkpoints A custom comparer is an object that comparer is an object that performs the bitmap performs the bitmap comparison for the checkpoint comparison for the checkpoint according to your testing according to your testing requirements QuickTest then requirements QuickTest then receives and reports the results receives and reports the results that the custom comparer that the custom comparer returnsreturns

Features of QTPFeatures of QTP

6 There are also some improvements 6 There are also some improvements in the Test Result Analysis eg in the Test Result Analysis eg QuickTest run results can now be QuickTest run results can now be exported to MS Word and PDF exported to MS Word and PDF format use of an image file as a format use of an image file as a fourth argument to fourth argument to ReporterReportEvent method select ReporterReportEvent method select jump to Step in QuickTest when you jump to Step in QuickTest when you right click any node in test results to right click any node in test results to show that step within the QuickTest show that step within the QuickTest testing document run results for testing document run results for tests and components that are run tests and components that are run as part of a Quality Center test set as part of a Quality Center test set now include the Quality Center now include the Quality Center server and project name etcserver and project name etc

Features of QTPFeatures of QTP

7 The new Delphi Add-in enables you to test Win32 VCL Delphi 7 The new Delphi Add-in enables you to test Win32 VCL Delphi controlscontrols

8 File gt Settings gt Local System Monitor enables you to monitor the 8 File gt Settings gt Local System Monitor enables you to monitor the local (clientside) computer resources used by the application local (clientside) computer resources used by the application instance you are testing during a run sessioninstance you are testing during a run session

There are some feature enhancements also like-There are some feature enhancements also like-You can upgrade from QTP 95 to QTP 10 without uninstalling QTP 95 You can upgrade from QTP 95 to QTP 10 without uninstalling QTP 95

firstfirstIntelliSense functionality is improvedIntelliSense functionality is improvedDesign and functionality of a debugger pane is improvedDesign and functionality of a debugger pane is improvedMaintenance Run mode now includes new Object Identification Maintenance Run mode now includes new Object Identification

SolutionsSolutionsAdded Control for Editing and Managing Actions in Automation ScriptsAdded Control for Editing and Managing Actions in Automation ScriptsA new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in Extensibility and much moreAn improved Web Add-in Extensibility and much more

Features of QTPFeatures of QTP

8 File gt Settings gt Local System 8 File gt Settings gt Local System Monitor enables you to monitor Monitor enables you to monitor the local (clientside) computer the local (clientside) computer resources used by the resources used by the application instance you are application instance you are testing during a run sessiontesting during a run session

Features of QTPFeatures of QTP

There are some feature There are some feature enhancements also like-enhancements also like-

You can upgrade from QTP 95 to You can upgrade from QTP 95 to QTP 10 without uninstalling QTP QTP 10 without uninstalling QTP 95 first95 first

IntelliSense functionality is IntelliSense functionality is improvedimproved

Design and functionality of a Design and functionality of a debugger pane is improveddebugger pane is improved

Features of QTPFeatures of QTP

Maintenance Run mode now Maintenance Run mode now includes new Object Identification includes new Object Identification SolutionsSolutions

Added Control for Editing and Added Control for Editing and Managing Actions in Automation Managing Actions in Automation ScriptsScripts

A new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in An improved Web Add-in

Extensibility and much moreExtensibility and much more

Features of QTPFeatures of QTP

XPath and CSS based object XPath and CSS based object identificationidentificationGood Looking and Enhanced Results Good Looking and Enhanced Results ViewerViewerEasy Regular ExpressionsEasy Regular ExpressionsNow identify objects not only in Now identify objects not only in relation to each other but in relation to relation to each other but in relation to neighboring objectsneighboring objectsLoad Function Libraries at Run TimeLoad Function Libraries at Run TimeTest Your GUI and UI-Less Application Test Your GUI and UI-Less Application Functionality in One TestFunctionality in One TestRecord SupportRecord SupportMuch Awaited Log Tracking is available Much Awaited Log Tracking is available nownow

ObjectsObjects

Objects are GUI entities qualified Objects are GUI entities qualified with some properties data and the with some properties data and the methods necessary to operate on methods necessary to operate on that datathat dataProperty describes the object Property describes the object defined which differentiates the defined which differentiates the given object with other objectsgiven object with other objectsMethods are functions required in Methods are functions required in order to manipulate the object order to manipulate the object propertiesproperties

ObjectsObjects

Example Example A Button is said to be A Button is said to be an object which consists of an object which consists of properties such as lsquoEnabledrsquo properties such as lsquoEnabledrsquo lsquoSizersquo and methods such as lsquoSizersquo and methods such as lsquoonClickrsquo lsquoOnFocusrsquo etclsquoonClickrsquo lsquoOnFocusrsquo etc

ObjectsObjects

Properties - These are Properties - These are characteristics of the object eg characteristics of the object eg the text on a button QTP uses the text on a button QTP uses this to recognize the objectthis to recognize the object

ObjectsObjects

Methods - These are built in Methods - These are built in functionality of the object The functionality of the object The VBScript code that we write (or VBScript code that we write (or record) actually makes calls to the record) actually makes calls to the methods of an object eg methods of an object eg ReporterReportEvent() Here ReporterReportEvent() Here ReportEvent is the method of the ReportEvent is the method of the Reporter objectReporter object

ObjectsObjects

Events - These are what can Events - These are what can be done to an object This is be done to an object This is used by programmers to used by programmers to determine what an object does determine what an object does in response to an action you in response to an action you perform It is however unused perform It is however unused in QTP in QTP

ObjectsObjects

QTP Object Identification ProcessQTP Object Identification Process

Object Identification The tool determines Object Identification The tool determines what properties of objects are recordedwhat properties of objects are recorded

Object Spy Allows users to view the Object Spy Allows users to view the property of an object without recording itproperty of an object without recording it

Object Repository Holds information Object Repository Holds information recorded about each object allowing the recorded about each object allowing the test to identify the object during test to identify the object during executionexecution

ObjectsObjects

Object Smart IdentificationObject Smart Identification Smart Identification is not Artificial Smart Identification is not Artificial IntelligenceIntelligenceSI uses looseunreliable object SI uses looseunreliable object recognitionrecognitionItrsquos recommended to disable SI for Itrsquos recommended to disable SI for each and every pagewindowcontrol each and every pagewindowcontrol using the Tools-gtObject Identification using the Tools-gtObject Identification dialog (Recording)dialog (Recording)Another way to disable SI File -gt Another way to disable SI File -gt Settings -gt Run -gt Check the Disable Settings -gt Run -gt Check the Disable Smart Identification during run Smart Identification during run session check box (Run-Time)session check box (Run-Time)

QTP EnvironmentQTP Environment

Windows Windows

1048707104870710487071048707C++ Visual Basic Java NETC++ C++ Visual Basic Java NETC++ NETNET

WebWeb

1048707104870710487071048707Web Applications Web services Web Applications Web services FlashFlash

Other technologiesOther technologies

1048707104870710487071048707SAP Siebel Oracle Peoplesoft SAP Siebel Oracle Peoplesoft ActiveXActiveX

Add-In architectureAdd-In architecture

Enables QTP to provide support for Enables QTP to provide support for multiple technologiesmultiple technologiesAdd-ins are software that need to Add-ins are software that need to be installed on a system that has be installed on a system that has QTP QTP It then becomes integrated with It then becomes integrated with the QTP environmentthe QTP environment

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 9: Qtp day 1

Features of QTPFeatures of QTP

3 LoadAndRunAction 3 LoadAndRunAction statement helps you load statement helps you load and run an action only when and run an action only when the step runs so that these the step runs so that these actions are not loaded each actions are not loaded each time you open a testtime you open a test

Features of QTPFeatures of QTP

4 You can centrally manage 4 You can centrally manage your work items and ToDo your work items and ToDo tasks in the To Do Pane tasks in the To Do Pane which enables you to create which enables you to create and control self-defined and control self-defined tasks and to view a tasks and to view a compiled set of the TODO compiled set of the TODO comments from your tests comments from your tests associated function libraries associated function libraries and componentsand components

Features of QTPFeatures of QTP

5 You can now develop your own 5 You can now develop your own algorithm to compare bitmap algorithm to compare bitmap checkpoints A custom checkpoints A custom comparer is an object that comparer is an object that performs the bitmap performs the bitmap comparison for the checkpoint comparison for the checkpoint according to your testing according to your testing requirements QuickTest then requirements QuickTest then receives and reports the results receives and reports the results that the custom comparer that the custom comparer returnsreturns

Features of QTPFeatures of QTP

6 There are also some improvements 6 There are also some improvements in the Test Result Analysis eg in the Test Result Analysis eg QuickTest run results can now be QuickTest run results can now be exported to MS Word and PDF exported to MS Word and PDF format use of an image file as a format use of an image file as a fourth argument to fourth argument to ReporterReportEvent method select ReporterReportEvent method select jump to Step in QuickTest when you jump to Step in QuickTest when you right click any node in test results to right click any node in test results to show that step within the QuickTest show that step within the QuickTest testing document run results for testing document run results for tests and components that are run tests and components that are run as part of a Quality Center test set as part of a Quality Center test set now include the Quality Center now include the Quality Center server and project name etcserver and project name etc

Features of QTPFeatures of QTP

7 The new Delphi Add-in enables you to test Win32 VCL Delphi 7 The new Delphi Add-in enables you to test Win32 VCL Delphi controlscontrols

8 File gt Settings gt Local System Monitor enables you to monitor the 8 File gt Settings gt Local System Monitor enables you to monitor the local (clientside) computer resources used by the application local (clientside) computer resources used by the application instance you are testing during a run sessioninstance you are testing during a run session

There are some feature enhancements also like-There are some feature enhancements also like-You can upgrade from QTP 95 to QTP 10 without uninstalling QTP 95 You can upgrade from QTP 95 to QTP 10 without uninstalling QTP 95

firstfirstIntelliSense functionality is improvedIntelliSense functionality is improvedDesign and functionality of a debugger pane is improvedDesign and functionality of a debugger pane is improvedMaintenance Run mode now includes new Object Identification Maintenance Run mode now includes new Object Identification

SolutionsSolutionsAdded Control for Editing and Managing Actions in Automation ScriptsAdded Control for Editing and Managing Actions in Automation ScriptsA new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in Extensibility and much moreAn improved Web Add-in Extensibility and much more

Features of QTPFeatures of QTP

8 File gt Settings gt Local System 8 File gt Settings gt Local System Monitor enables you to monitor Monitor enables you to monitor the local (clientside) computer the local (clientside) computer resources used by the resources used by the application instance you are application instance you are testing during a run sessiontesting during a run session

Features of QTPFeatures of QTP

There are some feature There are some feature enhancements also like-enhancements also like-

You can upgrade from QTP 95 to You can upgrade from QTP 95 to QTP 10 without uninstalling QTP QTP 10 without uninstalling QTP 95 first95 first

IntelliSense functionality is IntelliSense functionality is improvedimproved

Design and functionality of a Design and functionality of a debugger pane is improveddebugger pane is improved

Features of QTPFeatures of QTP

Maintenance Run mode now Maintenance Run mode now includes new Object Identification includes new Object Identification SolutionsSolutions

Added Control for Editing and Added Control for Editing and Managing Actions in Automation Managing Actions in Automation ScriptsScripts

A new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in An improved Web Add-in

Extensibility and much moreExtensibility and much more

Features of QTPFeatures of QTP

XPath and CSS based object XPath and CSS based object identificationidentificationGood Looking and Enhanced Results Good Looking and Enhanced Results ViewerViewerEasy Regular ExpressionsEasy Regular ExpressionsNow identify objects not only in Now identify objects not only in relation to each other but in relation to relation to each other but in relation to neighboring objectsneighboring objectsLoad Function Libraries at Run TimeLoad Function Libraries at Run TimeTest Your GUI and UI-Less Application Test Your GUI and UI-Less Application Functionality in One TestFunctionality in One TestRecord SupportRecord SupportMuch Awaited Log Tracking is available Much Awaited Log Tracking is available nownow

ObjectsObjects

Objects are GUI entities qualified Objects are GUI entities qualified with some properties data and the with some properties data and the methods necessary to operate on methods necessary to operate on that datathat dataProperty describes the object Property describes the object defined which differentiates the defined which differentiates the given object with other objectsgiven object with other objectsMethods are functions required in Methods are functions required in order to manipulate the object order to manipulate the object propertiesproperties

ObjectsObjects

Example Example A Button is said to be A Button is said to be an object which consists of an object which consists of properties such as lsquoEnabledrsquo properties such as lsquoEnabledrsquo lsquoSizersquo and methods such as lsquoSizersquo and methods such as lsquoonClickrsquo lsquoOnFocusrsquo etclsquoonClickrsquo lsquoOnFocusrsquo etc

ObjectsObjects

Properties - These are Properties - These are characteristics of the object eg characteristics of the object eg the text on a button QTP uses the text on a button QTP uses this to recognize the objectthis to recognize the object

ObjectsObjects

Methods - These are built in Methods - These are built in functionality of the object The functionality of the object The VBScript code that we write (or VBScript code that we write (or record) actually makes calls to the record) actually makes calls to the methods of an object eg methods of an object eg ReporterReportEvent() Here ReporterReportEvent() Here ReportEvent is the method of the ReportEvent is the method of the Reporter objectReporter object

ObjectsObjects

Events - These are what can Events - These are what can be done to an object This is be done to an object This is used by programmers to used by programmers to determine what an object does determine what an object does in response to an action you in response to an action you perform It is however unused perform It is however unused in QTP in QTP

ObjectsObjects

QTP Object Identification ProcessQTP Object Identification Process

Object Identification The tool determines Object Identification The tool determines what properties of objects are recordedwhat properties of objects are recorded

Object Spy Allows users to view the Object Spy Allows users to view the property of an object without recording itproperty of an object without recording it

Object Repository Holds information Object Repository Holds information recorded about each object allowing the recorded about each object allowing the test to identify the object during test to identify the object during executionexecution

ObjectsObjects

Object Smart IdentificationObject Smart Identification Smart Identification is not Artificial Smart Identification is not Artificial IntelligenceIntelligenceSI uses looseunreliable object SI uses looseunreliable object recognitionrecognitionItrsquos recommended to disable SI for Itrsquos recommended to disable SI for each and every pagewindowcontrol each and every pagewindowcontrol using the Tools-gtObject Identification using the Tools-gtObject Identification dialog (Recording)dialog (Recording)Another way to disable SI File -gt Another way to disable SI File -gt Settings -gt Run -gt Check the Disable Settings -gt Run -gt Check the Disable Smart Identification during run Smart Identification during run session check box (Run-Time)session check box (Run-Time)

QTP EnvironmentQTP Environment

Windows Windows

1048707104870710487071048707C++ Visual Basic Java NETC++ C++ Visual Basic Java NETC++ NETNET

WebWeb

1048707104870710487071048707Web Applications Web services Web Applications Web services FlashFlash

Other technologiesOther technologies

1048707104870710487071048707SAP Siebel Oracle Peoplesoft SAP Siebel Oracle Peoplesoft ActiveXActiveX

Add-In architectureAdd-In architecture

Enables QTP to provide support for Enables QTP to provide support for multiple technologiesmultiple technologiesAdd-ins are software that need to Add-ins are software that need to be installed on a system that has be installed on a system that has QTP QTP It then becomes integrated with It then becomes integrated with the QTP environmentthe QTP environment

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 10: Qtp day 1

Features of QTPFeatures of QTP

4 You can centrally manage 4 You can centrally manage your work items and ToDo your work items and ToDo tasks in the To Do Pane tasks in the To Do Pane which enables you to create which enables you to create and control self-defined and control self-defined tasks and to view a tasks and to view a compiled set of the TODO compiled set of the TODO comments from your tests comments from your tests associated function libraries associated function libraries and componentsand components

Features of QTPFeatures of QTP

5 You can now develop your own 5 You can now develop your own algorithm to compare bitmap algorithm to compare bitmap checkpoints A custom checkpoints A custom comparer is an object that comparer is an object that performs the bitmap performs the bitmap comparison for the checkpoint comparison for the checkpoint according to your testing according to your testing requirements QuickTest then requirements QuickTest then receives and reports the results receives and reports the results that the custom comparer that the custom comparer returnsreturns

Features of QTPFeatures of QTP

6 There are also some improvements 6 There are also some improvements in the Test Result Analysis eg in the Test Result Analysis eg QuickTest run results can now be QuickTest run results can now be exported to MS Word and PDF exported to MS Word and PDF format use of an image file as a format use of an image file as a fourth argument to fourth argument to ReporterReportEvent method select ReporterReportEvent method select jump to Step in QuickTest when you jump to Step in QuickTest when you right click any node in test results to right click any node in test results to show that step within the QuickTest show that step within the QuickTest testing document run results for testing document run results for tests and components that are run tests and components that are run as part of a Quality Center test set as part of a Quality Center test set now include the Quality Center now include the Quality Center server and project name etcserver and project name etc

Features of QTPFeatures of QTP

7 The new Delphi Add-in enables you to test Win32 VCL Delphi 7 The new Delphi Add-in enables you to test Win32 VCL Delphi controlscontrols

8 File gt Settings gt Local System Monitor enables you to monitor the 8 File gt Settings gt Local System Monitor enables you to monitor the local (clientside) computer resources used by the application local (clientside) computer resources used by the application instance you are testing during a run sessioninstance you are testing during a run session

There are some feature enhancements also like-There are some feature enhancements also like-You can upgrade from QTP 95 to QTP 10 without uninstalling QTP 95 You can upgrade from QTP 95 to QTP 10 without uninstalling QTP 95

firstfirstIntelliSense functionality is improvedIntelliSense functionality is improvedDesign and functionality of a debugger pane is improvedDesign and functionality of a debugger pane is improvedMaintenance Run mode now includes new Object Identification Maintenance Run mode now includes new Object Identification

SolutionsSolutionsAdded Control for Editing and Managing Actions in Automation ScriptsAdded Control for Editing and Managing Actions in Automation ScriptsA new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in Extensibility and much moreAn improved Web Add-in Extensibility and much more

Features of QTPFeatures of QTP

8 File gt Settings gt Local System 8 File gt Settings gt Local System Monitor enables you to monitor Monitor enables you to monitor the local (clientside) computer the local (clientside) computer resources used by the resources used by the application instance you are application instance you are testing during a run sessiontesting during a run session

Features of QTPFeatures of QTP

There are some feature There are some feature enhancements also like-enhancements also like-

You can upgrade from QTP 95 to You can upgrade from QTP 95 to QTP 10 without uninstalling QTP QTP 10 without uninstalling QTP 95 first95 first

IntelliSense functionality is IntelliSense functionality is improvedimproved

Design and functionality of a Design and functionality of a debugger pane is improveddebugger pane is improved

Features of QTPFeatures of QTP

Maintenance Run mode now Maintenance Run mode now includes new Object Identification includes new Object Identification SolutionsSolutions

Added Control for Editing and Added Control for Editing and Managing Actions in Automation Managing Actions in Automation ScriptsScripts

A new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in An improved Web Add-in

Extensibility and much moreExtensibility and much more

Features of QTPFeatures of QTP

XPath and CSS based object XPath and CSS based object identificationidentificationGood Looking and Enhanced Results Good Looking and Enhanced Results ViewerViewerEasy Regular ExpressionsEasy Regular ExpressionsNow identify objects not only in Now identify objects not only in relation to each other but in relation to relation to each other but in relation to neighboring objectsneighboring objectsLoad Function Libraries at Run TimeLoad Function Libraries at Run TimeTest Your GUI and UI-Less Application Test Your GUI and UI-Less Application Functionality in One TestFunctionality in One TestRecord SupportRecord SupportMuch Awaited Log Tracking is available Much Awaited Log Tracking is available nownow

ObjectsObjects

Objects are GUI entities qualified Objects are GUI entities qualified with some properties data and the with some properties data and the methods necessary to operate on methods necessary to operate on that datathat dataProperty describes the object Property describes the object defined which differentiates the defined which differentiates the given object with other objectsgiven object with other objectsMethods are functions required in Methods are functions required in order to manipulate the object order to manipulate the object propertiesproperties

ObjectsObjects

Example Example A Button is said to be A Button is said to be an object which consists of an object which consists of properties such as lsquoEnabledrsquo properties such as lsquoEnabledrsquo lsquoSizersquo and methods such as lsquoSizersquo and methods such as lsquoonClickrsquo lsquoOnFocusrsquo etclsquoonClickrsquo lsquoOnFocusrsquo etc

ObjectsObjects

Properties - These are Properties - These are characteristics of the object eg characteristics of the object eg the text on a button QTP uses the text on a button QTP uses this to recognize the objectthis to recognize the object

ObjectsObjects

Methods - These are built in Methods - These are built in functionality of the object The functionality of the object The VBScript code that we write (or VBScript code that we write (or record) actually makes calls to the record) actually makes calls to the methods of an object eg methods of an object eg ReporterReportEvent() Here ReporterReportEvent() Here ReportEvent is the method of the ReportEvent is the method of the Reporter objectReporter object

ObjectsObjects

Events - These are what can Events - These are what can be done to an object This is be done to an object This is used by programmers to used by programmers to determine what an object does determine what an object does in response to an action you in response to an action you perform It is however unused perform It is however unused in QTP in QTP

ObjectsObjects

QTP Object Identification ProcessQTP Object Identification Process

Object Identification The tool determines Object Identification The tool determines what properties of objects are recordedwhat properties of objects are recorded

Object Spy Allows users to view the Object Spy Allows users to view the property of an object without recording itproperty of an object without recording it

Object Repository Holds information Object Repository Holds information recorded about each object allowing the recorded about each object allowing the test to identify the object during test to identify the object during executionexecution

ObjectsObjects

Object Smart IdentificationObject Smart Identification Smart Identification is not Artificial Smart Identification is not Artificial IntelligenceIntelligenceSI uses looseunreliable object SI uses looseunreliable object recognitionrecognitionItrsquos recommended to disable SI for Itrsquos recommended to disable SI for each and every pagewindowcontrol each and every pagewindowcontrol using the Tools-gtObject Identification using the Tools-gtObject Identification dialog (Recording)dialog (Recording)Another way to disable SI File -gt Another way to disable SI File -gt Settings -gt Run -gt Check the Disable Settings -gt Run -gt Check the Disable Smart Identification during run Smart Identification during run session check box (Run-Time)session check box (Run-Time)

QTP EnvironmentQTP Environment

Windows Windows

1048707104870710487071048707C++ Visual Basic Java NETC++ C++ Visual Basic Java NETC++ NETNET

WebWeb

1048707104870710487071048707Web Applications Web services Web Applications Web services FlashFlash

Other technologiesOther technologies

1048707104870710487071048707SAP Siebel Oracle Peoplesoft SAP Siebel Oracle Peoplesoft ActiveXActiveX

Add-In architectureAdd-In architecture

Enables QTP to provide support for Enables QTP to provide support for multiple technologiesmultiple technologiesAdd-ins are software that need to Add-ins are software that need to be installed on a system that has be installed on a system that has QTP QTP It then becomes integrated with It then becomes integrated with the QTP environmentthe QTP environment

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 11: Qtp day 1

Features of QTPFeatures of QTP

5 You can now develop your own 5 You can now develop your own algorithm to compare bitmap algorithm to compare bitmap checkpoints A custom checkpoints A custom comparer is an object that comparer is an object that performs the bitmap performs the bitmap comparison for the checkpoint comparison for the checkpoint according to your testing according to your testing requirements QuickTest then requirements QuickTest then receives and reports the results receives and reports the results that the custom comparer that the custom comparer returnsreturns

Features of QTPFeatures of QTP

6 There are also some improvements 6 There are also some improvements in the Test Result Analysis eg in the Test Result Analysis eg QuickTest run results can now be QuickTest run results can now be exported to MS Word and PDF exported to MS Word and PDF format use of an image file as a format use of an image file as a fourth argument to fourth argument to ReporterReportEvent method select ReporterReportEvent method select jump to Step in QuickTest when you jump to Step in QuickTest when you right click any node in test results to right click any node in test results to show that step within the QuickTest show that step within the QuickTest testing document run results for testing document run results for tests and components that are run tests and components that are run as part of a Quality Center test set as part of a Quality Center test set now include the Quality Center now include the Quality Center server and project name etcserver and project name etc

Features of QTPFeatures of QTP

7 The new Delphi Add-in enables you to test Win32 VCL Delphi 7 The new Delphi Add-in enables you to test Win32 VCL Delphi controlscontrols

8 File gt Settings gt Local System Monitor enables you to monitor the 8 File gt Settings gt Local System Monitor enables you to monitor the local (clientside) computer resources used by the application local (clientside) computer resources used by the application instance you are testing during a run sessioninstance you are testing during a run session

There are some feature enhancements also like-There are some feature enhancements also like-You can upgrade from QTP 95 to QTP 10 without uninstalling QTP 95 You can upgrade from QTP 95 to QTP 10 without uninstalling QTP 95

firstfirstIntelliSense functionality is improvedIntelliSense functionality is improvedDesign and functionality of a debugger pane is improvedDesign and functionality of a debugger pane is improvedMaintenance Run mode now includes new Object Identification Maintenance Run mode now includes new Object Identification

SolutionsSolutionsAdded Control for Editing and Managing Actions in Automation ScriptsAdded Control for Editing and Managing Actions in Automation ScriptsA new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in Extensibility and much moreAn improved Web Add-in Extensibility and much more

Features of QTPFeatures of QTP

8 File gt Settings gt Local System 8 File gt Settings gt Local System Monitor enables you to monitor Monitor enables you to monitor the local (clientside) computer the local (clientside) computer resources used by the resources used by the application instance you are application instance you are testing during a run sessiontesting during a run session

Features of QTPFeatures of QTP

There are some feature There are some feature enhancements also like-enhancements also like-

You can upgrade from QTP 95 to You can upgrade from QTP 95 to QTP 10 without uninstalling QTP QTP 10 without uninstalling QTP 95 first95 first

IntelliSense functionality is IntelliSense functionality is improvedimproved

Design and functionality of a Design and functionality of a debugger pane is improveddebugger pane is improved

Features of QTPFeatures of QTP

Maintenance Run mode now Maintenance Run mode now includes new Object Identification includes new Object Identification SolutionsSolutions

Added Control for Editing and Added Control for Editing and Managing Actions in Automation Managing Actions in Automation ScriptsScripts

A new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in An improved Web Add-in

Extensibility and much moreExtensibility and much more

Features of QTPFeatures of QTP

XPath and CSS based object XPath and CSS based object identificationidentificationGood Looking and Enhanced Results Good Looking and Enhanced Results ViewerViewerEasy Regular ExpressionsEasy Regular ExpressionsNow identify objects not only in Now identify objects not only in relation to each other but in relation to relation to each other but in relation to neighboring objectsneighboring objectsLoad Function Libraries at Run TimeLoad Function Libraries at Run TimeTest Your GUI and UI-Less Application Test Your GUI and UI-Less Application Functionality in One TestFunctionality in One TestRecord SupportRecord SupportMuch Awaited Log Tracking is available Much Awaited Log Tracking is available nownow

ObjectsObjects

Objects are GUI entities qualified Objects are GUI entities qualified with some properties data and the with some properties data and the methods necessary to operate on methods necessary to operate on that datathat dataProperty describes the object Property describes the object defined which differentiates the defined which differentiates the given object with other objectsgiven object with other objectsMethods are functions required in Methods are functions required in order to manipulate the object order to manipulate the object propertiesproperties

ObjectsObjects

Example Example A Button is said to be A Button is said to be an object which consists of an object which consists of properties such as lsquoEnabledrsquo properties such as lsquoEnabledrsquo lsquoSizersquo and methods such as lsquoSizersquo and methods such as lsquoonClickrsquo lsquoOnFocusrsquo etclsquoonClickrsquo lsquoOnFocusrsquo etc

ObjectsObjects

Properties - These are Properties - These are characteristics of the object eg characteristics of the object eg the text on a button QTP uses the text on a button QTP uses this to recognize the objectthis to recognize the object

ObjectsObjects

Methods - These are built in Methods - These are built in functionality of the object The functionality of the object The VBScript code that we write (or VBScript code that we write (or record) actually makes calls to the record) actually makes calls to the methods of an object eg methods of an object eg ReporterReportEvent() Here ReporterReportEvent() Here ReportEvent is the method of the ReportEvent is the method of the Reporter objectReporter object

ObjectsObjects

Events - These are what can Events - These are what can be done to an object This is be done to an object This is used by programmers to used by programmers to determine what an object does determine what an object does in response to an action you in response to an action you perform It is however unused perform It is however unused in QTP in QTP

ObjectsObjects

QTP Object Identification ProcessQTP Object Identification Process

Object Identification The tool determines Object Identification The tool determines what properties of objects are recordedwhat properties of objects are recorded

Object Spy Allows users to view the Object Spy Allows users to view the property of an object without recording itproperty of an object without recording it

Object Repository Holds information Object Repository Holds information recorded about each object allowing the recorded about each object allowing the test to identify the object during test to identify the object during executionexecution

ObjectsObjects

Object Smart IdentificationObject Smart Identification Smart Identification is not Artificial Smart Identification is not Artificial IntelligenceIntelligenceSI uses looseunreliable object SI uses looseunreliable object recognitionrecognitionItrsquos recommended to disable SI for Itrsquos recommended to disable SI for each and every pagewindowcontrol each and every pagewindowcontrol using the Tools-gtObject Identification using the Tools-gtObject Identification dialog (Recording)dialog (Recording)Another way to disable SI File -gt Another way to disable SI File -gt Settings -gt Run -gt Check the Disable Settings -gt Run -gt Check the Disable Smart Identification during run Smart Identification during run session check box (Run-Time)session check box (Run-Time)

QTP EnvironmentQTP Environment

Windows Windows

1048707104870710487071048707C++ Visual Basic Java NETC++ C++ Visual Basic Java NETC++ NETNET

WebWeb

1048707104870710487071048707Web Applications Web services Web Applications Web services FlashFlash

Other technologiesOther technologies

1048707104870710487071048707SAP Siebel Oracle Peoplesoft SAP Siebel Oracle Peoplesoft ActiveXActiveX

Add-In architectureAdd-In architecture

Enables QTP to provide support for Enables QTP to provide support for multiple technologiesmultiple technologiesAdd-ins are software that need to Add-ins are software that need to be installed on a system that has be installed on a system that has QTP QTP It then becomes integrated with It then becomes integrated with the QTP environmentthe QTP environment

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 12: Qtp day 1

Features of QTPFeatures of QTP

6 There are also some improvements 6 There are also some improvements in the Test Result Analysis eg in the Test Result Analysis eg QuickTest run results can now be QuickTest run results can now be exported to MS Word and PDF exported to MS Word and PDF format use of an image file as a format use of an image file as a fourth argument to fourth argument to ReporterReportEvent method select ReporterReportEvent method select jump to Step in QuickTest when you jump to Step in QuickTest when you right click any node in test results to right click any node in test results to show that step within the QuickTest show that step within the QuickTest testing document run results for testing document run results for tests and components that are run tests and components that are run as part of a Quality Center test set as part of a Quality Center test set now include the Quality Center now include the Quality Center server and project name etcserver and project name etc

Features of QTPFeatures of QTP

7 The new Delphi Add-in enables you to test Win32 VCL Delphi 7 The new Delphi Add-in enables you to test Win32 VCL Delphi controlscontrols

8 File gt Settings gt Local System Monitor enables you to monitor the 8 File gt Settings gt Local System Monitor enables you to monitor the local (clientside) computer resources used by the application local (clientside) computer resources used by the application instance you are testing during a run sessioninstance you are testing during a run session

There are some feature enhancements also like-There are some feature enhancements also like-You can upgrade from QTP 95 to QTP 10 without uninstalling QTP 95 You can upgrade from QTP 95 to QTP 10 without uninstalling QTP 95

firstfirstIntelliSense functionality is improvedIntelliSense functionality is improvedDesign and functionality of a debugger pane is improvedDesign and functionality of a debugger pane is improvedMaintenance Run mode now includes new Object Identification Maintenance Run mode now includes new Object Identification

SolutionsSolutionsAdded Control for Editing and Managing Actions in Automation ScriptsAdded Control for Editing and Managing Actions in Automation ScriptsA new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in Extensibility and much moreAn improved Web Add-in Extensibility and much more

Features of QTPFeatures of QTP

8 File gt Settings gt Local System 8 File gt Settings gt Local System Monitor enables you to monitor Monitor enables you to monitor the local (clientside) computer the local (clientside) computer resources used by the resources used by the application instance you are application instance you are testing during a run sessiontesting during a run session

Features of QTPFeatures of QTP

There are some feature There are some feature enhancements also like-enhancements also like-

You can upgrade from QTP 95 to You can upgrade from QTP 95 to QTP 10 without uninstalling QTP QTP 10 without uninstalling QTP 95 first95 first

IntelliSense functionality is IntelliSense functionality is improvedimproved

Design and functionality of a Design and functionality of a debugger pane is improveddebugger pane is improved

Features of QTPFeatures of QTP

Maintenance Run mode now Maintenance Run mode now includes new Object Identification includes new Object Identification SolutionsSolutions

Added Control for Editing and Added Control for Editing and Managing Actions in Automation Managing Actions in Automation ScriptsScripts

A new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in An improved Web Add-in

Extensibility and much moreExtensibility and much more

Features of QTPFeatures of QTP

XPath and CSS based object XPath and CSS based object identificationidentificationGood Looking and Enhanced Results Good Looking and Enhanced Results ViewerViewerEasy Regular ExpressionsEasy Regular ExpressionsNow identify objects not only in Now identify objects not only in relation to each other but in relation to relation to each other but in relation to neighboring objectsneighboring objectsLoad Function Libraries at Run TimeLoad Function Libraries at Run TimeTest Your GUI and UI-Less Application Test Your GUI and UI-Less Application Functionality in One TestFunctionality in One TestRecord SupportRecord SupportMuch Awaited Log Tracking is available Much Awaited Log Tracking is available nownow

ObjectsObjects

Objects are GUI entities qualified Objects are GUI entities qualified with some properties data and the with some properties data and the methods necessary to operate on methods necessary to operate on that datathat dataProperty describes the object Property describes the object defined which differentiates the defined which differentiates the given object with other objectsgiven object with other objectsMethods are functions required in Methods are functions required in order to manipulate the object order to manipulate the object propertiesproperties

ObjectsObjects

Example Example A Button is said to be A Button is said to be an object which consists of an object which consists of properties such as lsquoEnabledrsquo properties such as lsquoEnabledrsquo lsquoSizersquo and methods such as lsquoSizersquo and methods such as lsquoonClickrsquo lsquoOnFocusrsquo etclsquoonClickrsquo lsquoOnFocusrsquo etc

ObjectsObjects

Properties - These are Properties - These are characteristics of the object eg characteristics of the object eg the text on a button QTP uses the text on a button QTP uses this to recognize the objectthis to recognize the object

ObjectsObjects

Methods - These are built in Methods - These are built in functionality of the object The functionality of the object The VBScript code that we write (or VBScript code that we write (or record) actually makes calls to the record) actually makes calls to the methods of an object eg methods of an object eg ReporterReportEvent() Here ReporterReportEvent() Here ReportEvent is the method of the ReportEvent is the method of the Reporter objectReporter object

ObjectsObjects

Events - These are what can Events - These are what can be done to an object This is be done to an object This is used by programmers to used by programmers to determine what an object does determine what an object does in response to an action you in response to an action you perform It is however unused perform It is however unused in QTP in QTP

ObjectsObjects

QTP Object Identification ProcessQTP Object Identification Process

Object Identification The tool determines Object Identification The tool determines what properties of objects are recordedwhat properties of objects are recorded

Object Spy Allows users to view the Object Spy Allows users to view the property of an object without recording itproperty of an object without recording it

Object Repository Holds information Object Repository Holds information recorded about each object allowing the recorded about each object allowing the test to identify the object during test to identify the object during executionexecution

ObjectsObjects

Object Smart IdentificationObject Smart Identification Smart Identification is not Artificial Smart Identification is not Artificial IntelligenceIntelligenceSI uses looseunreliable object SI uses looseunreliable object recognitionrecognitionItrsquos recommended to disable SI for Itrsquos recommended to disable SI for each and every pagewindowcontrol each and every pagewindowcontrol using the Tools-gtObject Identification using the Tools-gtObject Identification dialog (Recording)dialog (Recording)Another way to disable SI File -gt Another way to disable SI File -gt Settings -gt Run -gt Check the Disable Settings -gt Run -gt Check the Disable Smart Identification during run Smart Identification during run session check box (Run-Time)session check box (Run-Time)

QTP EnvironmentQTP Environment

Windows Windows

1048707104870710487071048707C++ Visual Basic Java NETC++ C++ Visual Basic Java NETC++ NETNET

WebWeb

1048707104870710487071048707Web Applications Web services Web Applications Web services FlashFlash

Other technologiesOther technologies

1048707104870710487071048707SAP Siebel Oracle Peoplesoft SAP Siebel Oracle Peoplesoft ActiveXActiveX

Add-In architectureAdd-In architecture

Enables QTP to provide support for Enables QTP to provide support for multiple technologiesmultiple technologiesAdd-ins are software that need to Add-ins are software that need to be installed on a system that has be installed on a system that has QTP QTP It then becomes integrated with It then becomes integrated with the QTP environmentthe QTP environment

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 13: Qtp day 1

Features of QTPFeatures of QTP

7 The new Delphi Add-in enables you to test Win32 VCL Delphi 7 The new Delphi Add-in enables you to test Win32 VCL Delphi controlscontrols

8 File gt Settings gt Local System Monitor enables you to monitor the 8 File gt Settings gt Local System Monitor enables you to monitor the local (clientside) computer resources used by the application local (clientside) computer resources used by the application instance you are testing during a run sessioninstance you are testing during a run session

There are some feature enhancements also like-There are some feature enhancements also like-You can upgrade from QTP 95 to QTP 10 without uninstalling QTP 95 You can upgrade from QTP 95 to QTP 10 without uninstalling QTP 95

firstfirstIntelliSense functionality is improvedIntelliSense functionality is improvedDesign and functionality of a debugger pane is improvedDesign and functionality of a debugger pane is improvedMaintenance Run mode now includes new Object Identification Maintenance Run mode now includes new Object Identification

SolutionsSolutionsAdded Control for Editing and Managing Actions in Automation ScriptsAdded Control for Editing and Managing Actions in Automation ScriptsA new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in Extensibility and much moreAn improved Web Add-in Extensibility and much more

Features of QTPFeatures of QTP

8 File gt Settings gt Local System 8 File gt Settings gt Local System Monitor enables you to monitor Monitor enables you to monitor the local (clientside) computer the local (clientside) computer resources used by the resources used by the application instance you are application instance you are testing during a run sessiontesting during a run session

Features of QTPFeatures of QTP

There are some feature There are some feature enhancements also like-enhancements also like-

You can upgrade from QTP 95 to You can upgrade from QTP 95 to QTP 10 without uninstalling QTP QTP 10 without uninstalling QTP 95 first95 first

IntelliSense functionality is IntelliSense functionality is improvedimproved

Design and functionality of a Design and functionality of a debugger pane is improveddebugger pane is improved

Features of QTPFeatures of QTP

Maintenance Run mode now Maintenance Run mode now includes new Object Identification includes new Object Identification SolutionsSolutions

Added Control for Editing and Added Control for Editing and Managing Actions in Automation Managing Actions in Automation ScriptsScripts

A new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in An improved Web Add-in

Extensibility and much moreExtensibility and much more

Features of QTPFeatures of QTP

XPath and CSS based object XPath and CSS based object identificationidentificationGood Looking and Enhanced Results Good Looking and Enhanced Results ViewerViewerEasy Regular ExpressionsEasy Regular ExpressionsNow identify objects not only in Now identify objects not only in relation to each other but in relation to relation to each other but in relation to neighboring objectsneighboring objectsLoad Function Libraries at Run TimeLoad Function Libraries at Run TimeTest Your GUI and UI-Less Application Test Your GUI and UI-Less Application Functionality in One TestFunctionality in One TestRecord SupportRecord SupportMuch Awaited Log Tracking is available Much Awaited Log Tracking is available nownow

ObjectsObjects

Objects are GUI entities qualified Objects are GUI entities qualified with some properties data and the with some properties data and the methods necessary to operate on methods necessary to operate on that datathat dataProperty describes the object Property describes the object defined which differentiates the defined which differentiates the given object with other objectsgiven object with other objectsMethods are functions required in Methods are functions required in order to manipulate the object order to manipulate the object propertiesproperties

ObjectsObjects

Example Example A Button is said to be A Button is said to be an object which consists of an object which consists of properties such as lsquoEnabledrsquo properties such as lsquoEnabledrsquo lsquoSizersquo and methods such as lsquoSizersquo and methods such as lsquoonClickrsquo lsquoOnFocusrsquo etclsquoonClickrsquo lsquoOnFocusrsquo etc

ObjectsObjects

Properties - These are Properties - These are characteristics of the object eg characteristics of the object eg the text on a button QTP uses the text on a button QTP uses this to recognize the objectthis to recognize the object

ObjectsObjects

Methods - These are built in Methods - These are built in functionality of the object The functionality of the object The VBScript code that we write (or VBScript code that we write (or record) actually makes calls to the record) actually makes calls to the methods of an object eg methods of an object eg ReporterReportEvent() Here ReporterReportEvent() Here ReportEvent is the method of the ReportEvent is the method of the Reporter objectReporter object

ObjectsObjects

Events - These are what can Events - These are what can be done to an object This is be done to an object This is used by programmers to used by programmers to determine what an object does determine what an object does in response to an action you in response to an action you perform It is however unused perform It is however unused in QTP in QTP

ObjectsObjects

QTP Object Identification ProcessQTP Object Identification Process

Object Identification The tool determines Object Identification The tool determines what properties of objects are recordedwhat properties of objects are recorded

Object Spy Allows users to view the Object Spy Allows users to view the property of an object without recording itproperty of an object without recording it

Object Repository Holds information Object Repository Holds information recorded about each object allowing the recorded about each object allowing the test to identify the object during test to identify the object during executionexecution

ObjectsObjects

Object Smart IdentificationObject Smart Identification Smart Identification is not Artificial Smart Identification is not Artificial IntelligenceIntelligenceSI uses looseunreliable object SI uses looseunreliable object recognitionrecognitionItrsquos recommended to disable SI for Itrsquos recommended to disable SI for each and every pagewindowcontrol each and every pagewindowcontrol using the Tools-gtObject Identification using the Tools-gtObject Identification dialog (Recording)dialog (Recording)Another way to disable SI File -gt Another way to disable SI File -gt Settings -gt Run -gt Check the Disable Settings -gt Run -gt Check the Disable Smart Identification during run Smart Identification during run session check box (Run-Time)session check box (Run-Time)

QTP EnvironmentQTP Environment

Windows Windows

1048707104870710487071048707C++ Visual Basic Java NETC++ C++ Visual Basic Java NETC++ NETNET

WebWeb

1048707104870710487071048707Web Applications Web services Web Applications Web services FlashFlash

Other technologiesOther technologies

1048707104870710487071048707SAP Siebel Oracle Peoplesoft SAP Siebel Oracle Peoplesoft ActiveXActiveX

Add-In architectureAdd-In architecture

Enables QTP to provide support for Enables QTP to provide support for multiple technologiesmultiple technologiesAdd-ins are software that need to Add-ins are software that need to be installed on a system that has be installed on a system that has QTP QTP It then becomes integrated with It then becomes integrated with the QTP environmentthe QTP environment

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 14: Qtp day 1

Features of QTPFeatures of QTP

8 File gt Settings gt Local System 8 File gt Settings gt Local System Monitor enables you to monitor Monitor enables you to monitor the local (clientside) computer the local (clientside) computer resources used by the resources used by the application instance you are application instance you are testing during a run sessiontesting during a run session

Features of QTPFeatures of QTP

There are some feature There are some feature enhancements also like-enhancements also like-

You can upgrade from QTP 95 to You can upgrade from QTP 95 to QTP 10 without uninstalling QTP QTP 10 without uninstalling QTP 95 first95 first

IntelliSense functionality is IntelliSense functionality is improvedimproved

Design and functionality of a Design and functionality of a debugger pane is improveddebugger pane is improved

Features of QTPFeatures of QTP

Maintenance Run mode now Maintenance Run mode now includes new Object Identification includes new Object Identification SolutionsSolutions

Added Control for Editing and Added Control for Editing and Managing Actions in Automation Managing Actions in Automation ScriptsScripts

A new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in An improved Web Add-in

Extensibility and much moreExtensibility and much more

Features of QTPFeatures of QTP

XPath and CSS based object XPath and CSS based object identificationidentificationGood Looking and Enhanced Results Good Looking and Enhanced Results ViewerViewerEasy Regular ExpressionsEasy Regular ExpressionsNow identify objects not only in Now identify objects not only in relation to each other but in relation to relation to each other but in relation to neighboring objectsneighboring objectsLoad Function Libraries at Run TimeLoad Function Libraries at Run TimeTest Your GUI and UI-Less Application Test Your GUI and UI-Less Application Functionality in One TestFunctionality in One TestRecord SupportRecord SupportMuch Awaited Log Tracking is available Much Awaited Log Tracking is available nownow

ObjectsObjects

Objects are GUI entities qualified Objects are GUI entities qualified with some properties data and the with some properties data and the methods necessary to operate on methods necessary to operate on that datathat dataProperty describes the object Property describes the object defined which differentiates the defined which differentiates the given object with other objectsgiven object with other objectsMethods are functions required in Methods are functions required in order to manipulate the object order to manipulate the object propertiesproperties

ObjectsObjects

Example Example A Button is said to be A Button is said to be an object which consists of an object which consists of properties such as lsquoEnabledrsquo properties such as lsquoEnabledrsquo lsquoSizersquo and methods such as lsquoSizersquo and methods such as lsquoonClickrsquo lsquoOnFocusrsquo etclsquoonClickrsquo lsquoOnFocusrsquo etc

ObjectsObjects

Properties - These are Properties - These are characteristics of the object eg characteristics of the object eg the text on a button QTP uses the text on a button QTP uses this to recognize the objectthis to recognize the object

ObjectsObjects

Methods - These are built in Methods - These are built in functionality of the object The functionality of the object The VBScript code that we write (or VBScript code that we write (or record) actually makes calls to the record) actually makes calls to the methods of an object eg methods of an object eg ReporterReportEvent() Here ReporterReportEvent() Here ReportEvent is the method of the ReportEvent is the method of the Reporter objectReporter object

ObjectsObjects

Events - These are what can Events - These are what can be done to an object This is be done to an object This is used by programmers to used by programmers to determine what an object does determine what an object does in response to an action you in response to an action you perform It is however unused perform It is however unused in QTP in QTP

ObjectsObjects

QTP Object Identification ProcessQTP Object Identification Process

Object Identification The tool determines Object Identification The tool determines what properties of objects are recordedwhat properties of objects are recorded

Object Spy Allows users to view the Object Spy Allows users to view the property of an object without recording itproperty of an object without recording it

Object Repository Holds information Object Repository Holds information recorded about each object allowing the recorded about each object allowing the test to identify the object during test to identify the object during executionexecution

ObjectsObjects

Object Smart IdentificationObject Smart Identification Smart Identification is not Artificial Smart Identification is not Artificial IntelligenceIntelligenceSI uses looseunreliable object SI uses looseunreliable object recognitionrecognitionItrsquos recommended to disable SI for Itrsquos recommended to disable SI for each and every pagewindowcontrol each and every pagewindowcontrol using the Tools-gtObject Identification using the Tools-gtObject Identification dialog (Recording)dialog (Recording)Another way to disable SI File -gt Another way to disable SI File -gt Settings -gt Run -gt Check the Disable Settings -gt Run -gt Check the Disable Smart Identification during run Smart Identification during run session check box (Run-Time)session check box (Run-Time)

QTP EnvironmentQTP Environment

Windows Windows

1048707104870710487071048707C++ Visual Basic Java NETC++ C++ Visual Basic Java NETC++ NETNET

WebWeb

1048707104870710487071048707Web Applications Web services Web Applications Web services FlashFlash

Other technologiesOther technologies

1048707104870710487071048707SAP Siebel Oracle Peoplesoft SAP Siebel Oracle Peoplesoft ActiveXActiveX

Add-In architectureAdd-In architecture

Enables QTP to provide support for Enables QTP to provide support for multiple technologiesmultiple technologiesAdd-ins are software that need to Add-ins are software that need to be installed on a system that has be installed on a system that has QTP QTP It then becomes integrated with It then becomes integrated with the QTP environmentthe QTP environment

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 15: Qtp day 1

Features of QTPFeatures of QTP

There are some feature There are some feature enhancements also like-enhancements also like-

You can upgrade from QTP 95 to You can upgrade from QTP 95 to QTP 10 without uninstalling QTP QTP 10 without uninstalling QTP 95 first95 first

IntelliSense functionality is IntelliSense functionality is improvedimproved

Design and functionality of a Design and functionality of a debugger pane is improveddebugger pane is improved

Features of QTPFeatures of QTP

Maintenance Run mode now Maintenance Run mode now includes new Object Identification includes new Object Identification SolutionsSolutions

Added Control for Editing and Added Control for Editing and Managing Actions in Automation Managing Actions in Automation ScriptsScripts

A new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in An improved Web Add-in

Extensibility and much moreExtensibility and much more

Features of QTPFeatures of QTP

XPath and CSS based object XPath and CSS based object identificationidentificationGood Looking and Enhanced Results Good Looking and Enhanced Results ViewerViewerEasy Regular ExpressionsEasy Regular ExpressionsNow identify objects not only in Now identify objects not only in relation to each other but in relation to relation to each other but in relation to neighboring objectsneighboring objectsLoad Function Libraries at Run TimeLoad Function Libraries at Run TimeTest Your GUI and UI-Less Application Test Your GUI and UI-Less Application Functionality in One TestFunctionality in One TestRecord SupportRecord SupportMuch Awaited Log Tracking is available Much Awaited Log Tracking is available nownow

ObjectsObjects

Objects are GUI entities qualified Objects are GUI entities qualified with some properties data and the with some properties data and the methods necessary to operate on methods necessary to operate on that datathat dataProperty describes the object Property describes the object defined which differentiates the defined which differentiates the given object with other objectsgiven object with other objectsMethods are functions required in Methods are functions required in order to manipulate the object order to manipulate the object propertiesproperties

ObjectsObjects

Example Example A Button is said to be A Button is said to be an object which consists of an object which consists of properties such as lsquoEnabledrsquo properties such as lsquoEnabledrsquo lsquoSizersquo and methods such as lsquoSizersquo and methods such as lsquoonClickrsquo lsquoOnFocusrsquo etclsquoonClickrsquo lsquoOnFocusrsquo etc

ObjectsObjects

Properties - These are Properties - These are characteristics of the object eg characteristics of the object eg the text on a button QTP uses the text on a button QTP uses this to recognize the objectthis to recognize the object

ObjectsObjects

Methods - These are built in Methods - These are built in functionality of the object The functionality of the object The VBScript code that we write (or VBScript code that we write (or record) actually makes calls to the record) actually makes calls to the methods of an object eg methods of an object eg ReporterReportEvent() Here ReporterReportEvent() Here ReportEvent is the method of the ReportEvent is the method of the Reporter objectReporter object

ObjectsObjects

Events - These are what can Events - These are what can be done to an object This is be done to an object This is used by programmers to used by programmers to determine what an object does determine what an object does in response to an action you in response to an action you perform It is however unused perform It is however unused in QTP in QTP

ObjectsObjects

QTP Object Identification ProcessQTP Object Identification Process

Object Identification The tool determines Object Identification The tool determines what properties of objects are recordedwhat properties of objects are recorded

Object Spy Allows users to view the Object Spy Allows users to view the property of an object without recording itproperty of an object without recording it

Object Repository Holds information Object Repository Holds information recorded about each object allowing the recorded about each object allowing the test to identify the object during test to identify the object during executionexecution

ObjectsObjects

Object Smart IdentificationObject Smart Identification Smart Identification is not Artificial Smart Identification is not Artificial IntelligenceIntelligenceSI uses looseunreliable object SI uses looseunreliable object recognitionrecognitionItrsquos recommended to disable SI for Itrsquos recommended to disable SI for each and every pagewindowcontrol each and every pagewindowcontrol using the Tools-gtObject Identification using the Tools-gtObject Identification dialog (Recording)dialog (Recording)Another way to disable SI File -gt Another way to disable SI File -gt Settings -gt Run -gt Check the Disable Settings -gt Run -gt Check the Disable Smart Identification during run Smart Identification during run session check box (Run-Time)session check box (Run-Time)

QTP EnvironmentQTP Environment

Windows Windows

1048707104870710487071048707C++ Visual Basic Java NETC++ C++ Visual Basic Java NETC++ NETNET

WebWeb

1048707104870710487071048707Web Applications Web services Web Applications Web services FlashFlash

Other technologiesOther technologies

1048707104870710487071048707SAP Siebel Oracle Peoplesoft SAP Siebel Oracle Peoplesoft ActiveXActiveX

Add-In architectureAdd-In architecture

Enables QTP to provide support for Enables QTP to provide support for multiple technologiesmultiple technologiesAdd-ins are software that need to Add-ins are software that need to be installed on a system that has be installed on a system that has QTP QTP It then becomes integrated with It then becomes integrated with the QTP environmentthe QTP environment

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 16: Qtp day 1

Features of QTPFeatures of QTP

Maintenance Run mode now Maintenance Run mode now includes new Object Identification includes new Object Identification SolutionsSolutions

Added Control for Editing and Added Control for Editing and Managing Actions in Automation Managing Actions in Automation ScriptsScripts

A new look for some dialog boxesA new look for some dialog boxesAn improved Web Add-in An improved Web Add-in

Extensibility and much moreExtensibility and much more

Features of QTPFeatures of QTP

XPath and CSS based object XPath and CSS based object identificationidentificationGood Looking and Enhanced Results Good Looking and Enhanced Results ViewerViewerEasy Regular ExpressionsEasy Regular ExpressionsNow identify objects not only in Now identify objects not only in relation to each other but in relation to relation to each other but in relation to neighboring objectsneighboring objectsLoad Function Libraries at Run TimeLoad Function Libraries at Run TimeTest Your GUI and UI-Less Application Test Your GUI and UI-Less Application Functionality in One TestFunctionality in One TestRecord SupportRecord SupportMuch Awaited Log Tracking is available Much Awaited Log Tracking is available nownow

ObjectsObjects

Objects are GUI entities qualified Objects are GUI entities qualified with some properties data and the with some properties data and the methods necessary to operate on methods necessary to operate on that datathat dataProperty describes the object Property describes the object defined which differentiates the defined which differentiates the given object with other objectsgiven object with other objectsMethods are functions required in Methods are functions required in order to manipulate the object order to manipulate the object propertiesproperties

ObjectsObjects

Example Example A Button is said to be A Button is said to be an object which consists of an object which consists of properties such as lsquoEnabledrsquo properties such as lsquoEnabledrsquo lsquoSizersquo and methods such as lsquoSizersquo and methods such as lsquoonClickrsquo lsquoOnFocusrsquo etclsquoonClickrsquo lsquoOnFocusrsquo etc

ObjectsObjects

Properties - These are Properties - These are characteristics of the object eg characteristics of the object eg the text on a button QTP uses the text on a button QTP uses this to recognize the objectthis to recognize the object

ObjectsObjects

Methods - These are built in Methods - These are built in functionality of the object The functionality of the object The VBScript code that we write (or VBScript code that we write (or record) actually makes calls to the record) actually makes calls to the methods of an object eg methods of an object eg ReporterReportEvent() Here ReporterReportEvent() Here ReportEvent is the method of the ReportEvent is the method of the Reporter objectReporter object

ObjectsObjects

Events - These are what can Events - These are what can be done to an object This is be done to an object This is used by programmers to used by programmers to determine what an object does determine what an object does in response to an action you in response to an action you perform It is however unused perform It is however unused in QTP in QTP

ObjectsObjects

QTP Object Identification ProcessQTP Object Identification Process

Object Identification The tool determines Object Identification The tool determines what properties of objects are recordedwhat properties of objects are recorded

Object Spy Allows users to view the Object Spy Allows users to view the property of an object without recording itproperty of an object without recording it

Object Repository Holds information Object Repository Holds information recorded about each object allowing the recorded about each object allowing the test to identify the object during test to identify the object during executionexecution

ObjectsObjects

Object Smart IdentificationObject Smart Identification Smart Identification is not Artificial Smart Identification is not Artificial IntelligenceIntelligenceSI uses looseunreliable object SI uses looseunreliable object recognitionrecognitionItrsquos recommended to disable SI for Itrsquos recommended to disable SI for each and every pagewindowcontrol each and every pagewindowcontrol using the Tools-gtObject Identification using the Tools-gtObject Identification dialog (Recording)dialog (Recording)Another way to disable SI File -gt Another way to disable SI File -gt Settings -gt Run -gt Check the Disable Settings -gt Run -gt Check the Disable Smart Identification during run Smart Identification during run session check box (Run-Time)session check box (Run-Time)

QTP EnvironmentQTP Environment

Windows Windows

1048707104870710487071048707C++ Visual Basic Java NETC++ C++ Visual Basic Java NETC++ NETNET

WebWeb

1048707104870710487071048707Web Applications Web services Web Applications Web services FlashFlash

Other technologiesOther technologies

1048707104870710487071048707SAP Siebel Oracle Peoplesoft SAP Siebel Oracle Peoplesoft ActiveXActiveX

Add-In architectureAdd-In architecture

Enables QTP to provide support for Enables QTP to provide support for multiple technologiesmultiple technologiesAdd-ins are software that need to Add-ins are software that need to be installed on a system that has be installed on a system that has QTP QTP It then becomes integrated with It then becomes integrated with the QTP environmentthe QTP environment

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 17: Qtp day 1

Features of QTPFeatures of QTP

XPath and CSS based object XPath and CSS based object identificationidentificationGood Looking and Enhanced Results Good Looking and Enhanced Results ViewerViewerEasy Regular ExpressionsEasy Regular ExpressionsNow identify objects not only in Now identify objects not only in relation to each other but in relation to relation to each other but in relation to neighboring objectsneighboring objectsLoad Function Libraries at Run TimeLoad Function Libraries at Run TimeTest Your GUI and UI-Less Application Test Your GUI and UI-Less Application Functionality in One TestFunctionality in One TestRecord SupportRecord SupportMuch Awaited Log Tracking is available Much Awaited Log Tracking is available nownow

ObjectsObjects

Objects are GUI entities qualified Objects are GUI entities qualified with some properties data and the with some properties data and the methods necessary to operate on methods necessary to operate on that datathat dataProperty describes the object Property describes the object defined which differentiates the defined which differentiates the given object with other objectsgiven object with other objectsMethods are functions required in Methods are functions required in order to manipulate the object order to manipulate the object propertiesproperties

ObjectsObjects

Example Example A Button is said to be A Button is said to be an object which consists of an object which consists of properties such as lsquoEnabledrsquo properties such as lsquoEnabledrsquo lsquoSizersquo and methods such as lsquoSizersquo and methods such as lsquoonClickrsquo lsquoOnFocusrsquo etclsquoonClickrsquo lsquoOnFocusrsquo etc

ObjectsObjects

Properties - These are Properties - These are characteristics of the object eg characteristics of the object eg the text on a button QTP uses the text on a button QTP uses this to recognize the objectthis to recognize the object

ObjectsObjects

Methods - These are built in Methods - These are built in functionality of the object The functionality of the object The VBScript code that we write (or VBScript code that we write (or record) actually makes calls to the record) actually makes calls to the methods of an object eg methods of an object eg ReporterReportEvent() Here ReporterReportEvent() Here ReportEvent is the method of the ReportEvent is the method of the Reporter objectReporter object

ObjectsObjects

Events - These are what can Events - These are what can be done to an object This is be done to an object This is used by programmers to used by programmers to determine what an object does determine what an object does in response to an action you in response to an action you perform It is however unused perform It is however unused in QTP in QTP

ObjectsObjects

QTP Object Identification ProcessQTP Object Identification Process

Object Identification The tool determines Object Identification The tool determines what properties of objects are recordedwhat properties of objects are recorded

Object Spy Allows users to view the Object Spy Allows users to view the property of an object without recording itproperty of an object without recording it

Object Repository Holds information Object Repository Holds information recorded about each object allowing the recorded about each object allowing the test to identify the object during test to identify the object during executionexecution

ObjectsObjects

Object Smart IdentificationObject Smart Identification Smart Identification is not Artificial Smart Identification is not Artificial IntelligenceIntelligenceSI uses looseunreliable object SI uses looseunreliable object recognitionrecognitionItrsquos recommended to disable SI for Itrsquos recommended to disable SI for each and every pagewindowcontrol each and every pagewindowcontrol using the Tools-gtObject Identification using the Tools-gtObject Identification dialog (Recording)dialog (Recording)Another way to disable SI File -gt Another way to disable SI File -gt Settings -gt Run -gt Check the Disable Settings -gt Run -gt Check the Disable Smart Identification during run Smart Identification during run session check box (Run-Time)session check box (Run-Time)

QTP EnvironmentQTP Environment

Windows Windows

1048707104870710487071048707C++ Visual Basic Java NETC++ C++ Visual Basic Java NETC++ NETNET

WebWeb

1048707104870710487071048707Web Applications Web services Web Applications Web services FlashFlash

Other technologiesOther technologies

1048707104870710487071048707SAP Siebel Oracle Peoplesoft SAP Siebel Oracle Peoplesoft ActiveXActiveX

Add-In architectureAdd-In architecture

Enables QTP to provide support for Enables QTP to provide support for multiple technologiesmultiple technologiesAdd-ins are software that need to Add-ins are software that need to be installed on a system that has be installed on a system that has QTP QTP It then becomes integrated with It then becomes integrated with the QTP environmentthe QTP environment

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 18: Qtp day 1

ObjectsObjects

Objects are GUI entities qualified Objects are GUI entities qualified with some properties data and the with some properties data and the methods necessary to operate on methods necessary to operate on that datathat dataProperty describes the object Property describes the object defined which differentiates the defined which differentiates the given object with other objectsgiven object with other objectsMethods are functions required in Methods are functions required in order to manipulate the object order to manipulate the object propertiesproperties

ObjectsObjects

Example Example A Button is said to be A Button is said to be an object which consists of an object which consists of properties such as lsquoEnabledrsquo properties such as lsquoEnabledrsquo lsquoSizersquo and methods such as lsquoSizersquo and methods such as lsquoonClickrsquo lsquoOnFocusrsquo etclsquoonClickrsquo lsquoOnFocusrsquo etc

ObjectsObjects

Properties - These are Properties - These are characteristics of the object eg characteristics of the object eg the text on a button QTP uses the text on a button QTP uses this to recognize the objectthis to recognize the object

ObjectsObjects

Methods - These are built in Methods - These are built in functionality of the object The functionality of the object The VBScript code that we write (or VBScript code that we write (or record) actually makes calls to the record) actually makes calls to the methods of an object eg methods of an object eg ReporterReportEvent() Here ReporterReportEvent() Here ReportEvent is the method of the ReportEvent is the method of the Reporter objectReporter object

ObjectsObjects

Events - These are what can Events - These are what can be done to an object This is be done to an object This is used by programmers to used by programmers to determine what an object does determine what an object does in response to an action you in response to an action you perform It is however unused perform It is however unused in QTP in QTP

ObjectsObjects

QTP Object Identification ProcessQTP Object Identification Process

Object Identification The tool determines Object Identification The tool determines what properties of objects are recordedwhat properties of objects are recorded

Object Spy Allows users to view the Object Spy Allows users to view the property of an object without recording itproperty of an object without recording it

Object Repository Holds information Object Repository Holds information recorded about each object allowing the recorded about each object allowing the test to identify the object during test to identify the object during executionexecution

ObjectsObjects

Object Smart IdentificationObject Smart Identification Smart Identification is not Artificial Smart Identification is not Artificial IntelligenceIntelligenceSI uses looseunreliable object SI uses looseunreliable object recognitionrecognitionItrsquos recommended to disable SI for Itrsquos recommended to disable SI for each and every pagewindowcontrol each and every pagewindowcontrol using the Tools-gtObject Identification using the Tools-gtObject Identification dialog (Recording)dialog (Recording)Another way to disable SI File -gt Another way to disable SI File -gt Settings -gt Run -gt Check the Disable Settings -gt Run -gt Check the Disable Smart Identification during run Smart Identification during run session check box (Run-Time)session check box (Run-Time)

QTP EnvironmentQTP Environment

Windows Windows

1048707104870710487071048707C++ Visual Basic Java NETC++ C++ Visual Basic Java NETC++ NETNET

WebWeb

1048707104870710487071048707Web Applications Web services Web Applications Web services FlashFlash

Other technologiesOther technologies

1048707104870710487071048707SAP Siebel Oracle Peoplesoft SAP Siebel Oracle Peoplesoft ActiveXActiveX

Add-In architectureAdd-In architecture

Enables QTP to provide support for Enables QTP to provide support for multiple technologiesmultiple technologiesAdd-ins are software that need to Add-ins are software that need to be installed on a system that has be installed on a system that has QTP QTP It then becomes integrated with It then becomes integrated with the QTP environmentthe QTP environment

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 19: Qtp day 1

ObjectsObjects

Example Example A Button is said to be A Button is said to be an object which consists of an object which consists of properties such as lsquoEnabledrsquo properties such as lsquoEnabledrsquo lsquoSizersquo and methods such as lsquoSizersquo and methods such as lsquoonClickrsquo lsquoOnFocusrsquo etclsquoonClickrsquo lsquoOnFocusrsquo etc

ObjectsObjects

Properties - These are Properties - These are characteristics of the object eg characteristics of the object eg the text on a button QTP uses the text on a button QTP uses this to recognize the objectthis to recognize the object

ObjectsObjects

Methods - These are built in Methods - These are built in functionality of the object The functionality of the object The VBScript code that we write (or VBScript code that we write (or record) actually makes calls to the record) actually makes calls to the methods of an object eg methods of an object eg ReporterReportEvent() Here ReporterReportEvent() Here ReportEvent is the method of the ReportEvent is the method of the Reporter objectReporter object

ObjectsObjects

Events - These are what can Events - These are what can be done to an object This is be done to an object This is used by programmers to used by programmers to determine what an object does determine what an object does in response to an action you in response to an action you perform It is however unused perform It is however unused in QTP in QTP

ObjectsObjects

QTP Object Identification ProcessQTP Object Identification Process

Object Identification The tool determines Object Identification The tool determines what properties of objects are recordedwhat properties of objects are recorded

Object Spy Allows users to view the Object Spy Allows users to view the property of an object without recording itproperty of an object without recording it

Object Repository Holds information Object Repository Holds information recorded about each object allowing the recorded about each object allowing the test to identify the object during test to identify the object during executionexecution

ObjectsObjects

Object Smart IdentificationObject Smart Identification Smart Identification is not Artificial Smart Identification is not Artificial IntelligenceIntelligenceSI uses looseunreliable object SI uses looseunreliable object recognitionrecognitionItrsquos recommended to disable SI for Itrsquos recommended to disable SI for each and every pagewindowcontrol each and every pagewindowcontrol using the Tools-gtObject Identification using the Tools-gtObject Identification dialog (Recording)dialog (Recording)Another way to disable SI File -gt Another way to disable SI File -gt Settings -gt Run -gt Check the Disable Settings -gt Run -gt Check the Disable Smart Identification during run Smart Identification during run session check box (Run-Time)session check box (Run-Time)

QTP EnvironmentQTP Environment

Windows Windows

1048707104870710487071048707C++ Visual Basic Java NETC++ C++ Visual Basic Java NETC++ NETNET

WebWeb

1048707104870710487071048707Web Applications Web services Web Applications Web services FlashFlash

Other technologiesOther technologies

1048707104870710487071048707SAP Siebel Oracle Peoplesoft SAP Siebel Oracle Peoplesoft ActiveXActiveX

Add-In architectureAdd-In architecture

Enables QTP to provide support for Enables QTP to provide support for multiple technologiesmultiple technologiesAdd-ins are software that need to Add-ins are software that need to be installed on a system that has be installed on a system that has QTP QTP It then becomes integrated with It then becomes integrated with the QTP environmentthe QTP environment

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 20: Qtp day 1

ObjectsObjects

Properties - These are Properties - These are characteristics of the object eg characteristics of the object eg the text on a button QTP uses the text on a button QTP uses this to recognize the objectthis to recognize the object

ObjectsObjects

Methods - These are built in Methods - These are built in functionality of the object The functionality of the object The VBScript code that we write (or VBScript code that we write (or record) actually makes calls to the record) actually makes calls to the methods of an object eg methods of an object eg ReporterReportEvent() Here ReporterReportEvent() Here ReportEvent is the method of the ReportEvent is the method of the Reporter objectReporter object

ObjectsObjects

Events - These are what can Events - These are what can be done to an object This is be done to an object This is used by programmers to used by programmers to determine what an object does determine what an object does in response to an action you in response to an action you perform It is however unused perform It is however unused in QTP in QTP

ObjectsObjects

QTP Object Identification ProcessQTP Object Identification Process

Object Identification The tool determines Object Identification The tool determines what properties of objects are recordedwhat properties of objects are recorded

Object Spy Allows users to view the Object Spy Allows users to view the property of an object without recording itproperty of an object without recording it

Object Repository Holds information Object Repository Holds information recorded about each object allowing the recorded about each object allowing the test to identify the object during test to identify the object during executionexecution

ObjectsObjects

Object Smart IdentificationObject Smart Identification Smart Identification is not Artificial Smart Identification is not Artificial IntelligenceIntelligenceSI uses looseunreliable object SI uses looseunreliable object recognitionrecognitionItrsquos recommended to disable SI for Itrsquos recommended to disable SI for each and every pagewindowcontrol each and every pagewindowcontrol using the Tools-gtObject Identification using the Tools-gtObject Identification dialog (Recording)dialog (Recording)Another way to disable SI File -gt Another way to disable SI File -gt Settings -gt Run -gt Check the Disable Settings -gt Run -gt Check the Disable Smart Identification during run Smart Identification during run session check box (Run-Time)session check box (Run-Time)

QTP EnvironmentQTP Environment

Windows Windows

1048707104870710487071048707C++ Visual Basic Java NETC++ C++ Visual Basic Java NETC++ NETNET

WebWeb

1048707104870710487071048707Web Applications Web services Web Applications Web services FlashFlash

Other technologiesOther technologies

1048707104870710487071048707SAP Siebel Oracle Peoplesoft SAP Siebel Oracle Peoplesoft ActiveXActiveX

Add-In architectureAdd-In architecture

Enables QTP to provide support for Enables QTP to provide support for multiple technologiesmultiple technologiesAdd-ins are software that need to Add-ins are software that need to be installed on a system that has be installed on a system that has QTP QTP It then becomes integrated with It then becomes integrated with the QTP environmentthe QTP environment

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 21: Qtp day 1

ObjectsObjects

Methods - These are built in Methods - These are built in functionality of the object The functionality of the object The VBScript code that we write (or VBScript code that we write (or record) actually makes calls to the record) actually makes calls to the methods of an object eg methods of an object eg ReporterReportEvent() Here ReporterReportEvent() Here ReportEvent is the method of the ReportEvent is the method of the Reporter objectReporter object

ObjectsObjects

Events - These are what can Events - These are what can be done to an object This is be done to an object This is used by programmers to used by programmers to determine what an object does determine what an object does in response to an action you in response to an action you perform It is however unused perform It is however unused in QTP in QTP

ObjectsObjects

QTP Object Identification ProcessQTP Object Identification Process

Object Identification The tool determines Object Identification The tool determines what properties of objects are recordedwhat properties of objects are recorded

Object Spy Allows users to view the Object Spy Allows users to view the property of an object without recording itproperty of an object without recording it

Object Repository Holds information Object Repository Holds information recorded about each object allowing the recorded about each object allowing the test to identify the object during test to identify the object during executionexecution

ObjectsObjects

Object Smart IdentificationObject Smart Identification Smart Identification is not Artificial Smart Identification is not Artificial IntelligenceIntelligenceSI uses looseunreliable object SI uses looseunreliable object recognitionrecognitionItrsquos recommended to disable SI for Itrsquos recommended to disable SI for each and every pagewindowcontrol each and every pagewindowcontrol using the Tools-gtObject Identification using the Tools-gtObject Identification dialog (Recording)dialog (Recording)Another way to disable SI File -gt Another way to disable SI File -gt Settings -gt Run -gt Check the Disable Settings -gt Run -gt Check the Disable Smart Identification during run Smart Identification during run session check box (Run-Time)session check box (Run-Time)

QTP EnvironmentQTP Environment

Windows Windows

1048707104870710487071048707C++ Visual Basic Java NETC++ C++ Visual Basic Java NETC++ NETNET

WebWeb

1048707104870710487071048707Web Applications Web services Web Applications Web services FlashFlash

Other technologiesOther technologies

1048707104870710487071048707SAP Siebel Oracle Peoplesoft SAP Siebel Oracle Peoplesoft ActiveXActiveX

Add-In architectureAdd-In architecture

Enables QTP to provide support for Enables QTP to provide support for multiple technologiesmultiple technologiesAdd-ins are software that need to Add-ins are software that need to be installed on a system that has be installed on a system that has QTP QTP It then becomes integrated with It then becomes integrated with the QTP environmentthe QTP environment

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 22: Qtp day 1

ObjectsObjects

Events - These are what can Events - These are what can be done to an object This is be done to an object This is used by programmers to used by programmers to determine what an object does determine what an object does in response to an action you in response to an action you perform It is however unused perform It is however unused in QTP in QTP

ObjectsObjects

QTP Object Identification ProcessQTP Object Identification Process

Object Identification The tool determines Object Identification The tool determines what properties of objects are recordedwhat properties of objects are recorded

Object Spy Allows users to view the Object Spy Allows users to view the property of an object without recording itproperty of an object without recording it

Object Repository Holds information Object Repository Holds information recorded about each object allowing the recorded about each object allowing the test to identify the object during test to identify the object during executionexecution

ObjectsObjects

Object Smart IdentificationObject Smart Identification Smart Identification is not Artificial Smart Identification is not Artificial IntelligenceIntelligenceSI uses looseunreliable object SI uses looseunreliable object recognitionrecognitionItrsquos recommended to disable SI for Itrsquos recommended to disable SI for each and every pagewindowcontrol each and every pagewindowcontrol using the Tools-gtObject Identification using the Tools-gtObject Identification dialog (Recording)dialog (Recording)Another way to disable SI File -gt Another way to disable SI File -gt Settings -gt Run -gt Check the Disable Settings -gt Run -gt Check the Disable Smart Identification during run Smart Identification during run session check box (Run-Time)session check box (Run-Time)

QTP EnvironmentQTP Environment

Windows Windows

1048707104870710487071048707C++ Visual Basic Java NETC++ C++ Visual Basic Java NETC++ NETNET

WebWeb

1048707104870710487071048707Web Applications Web services Web Applications Web services FlashFlash

Other technologiesOther technologies

1048707104870710487071048707SAP Siebel Oracle Peoplesoft SAP Siebel Oracle Peoplesoft ActiveXActiveX

Add-In architectureAdd-In architecture

Enables QTP to provide support for Enables QTP to provide support for multiple technologiesmultiple technologiesAdd-ins are software that need to Add-ins are software that need to be installed on a system that has be installed on a system that has QTP QTP It then becomes integrated with It then becomes integrated with the QTP environmentthe QTP environment

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 23: Qtp day 1

ObjectsObjects

QTP Object Identification ProcessQTP Object Identification Process

Object Identification The tool determines Object Identification The tool determines what properties of objects are recordedwhat properties of objects are recorded

Object Spy Allows users to view the Object Spy Allows users to view the property of an object without recording itproperty of an object without recording it

Object Repository Holds information Object Repository Holds information recorded about each object allowing the recorded about each object allowing the test to identify the object during test to identify the object during executionexecution

ObjectsObjects

Object Smart IdentificationObject Smart Identification Smart Identification is not Artificial Smart Identification is not Artificial IntelligenceIntelligenceSI uses looseunreliable object SI uses looseunreliable object recognitionrecognitionItrsquos recommended to disable SI for Itrsquos recommended to disable SI for each and every pagewindowcontrol each and every pagewindowcontrol using the Tools-gtObject Identification using the Tools-gtObject Identification dialog (Recording)dialog (Recording)Another way to disable SI File -gt Another way to disable SI File -gt Settings -gt Run -gt Check the Disable Settings -gt Run -gt Check the Disable Smart Identification during run Smart Identification during run session check box (Run-Time)session check box (Run-Time)

QTP EnvironmentQTP Environment

Windows Windows

1048707104870710487071048707C++ Visual Basic Java NETC++ C++ Visual Basic Java NETC++ NETNET

WebWeb

1048707104870710487071048707Web Applications Web services Web Applications Web services FlashFlash

Other technologiesOther technologies

1048707104870710487071048707SAP Siebel Oracle Peoplesoft SAP Siebel Oracle Peoplesoft ActiveXActiveX

Add-In architectureAdd-In architecture

Enables QTP to provide support for Enables QTP to provide support for multiple technologiesmultiple technologiesAdd-ins are software that need to Add-ins are software that need to be installed on a system that has be installed on a system that has QTP QTP It then becomes integrated with It then becomes integrated with the QTP environmentthe QTP environment

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 24: Qtp day 1

ObjectsObjects

Object Smart IdentificationObject Smart Identification Smart Identification is not Artificial Smart Identification is not Artificial IntelligenceIntelligenceSI uses looseunreliable object SI uses looseunreliable object recognitionrecognitionItrsquos recommended to disable SI for Itrsquos recommended to disable SI for each and every pagewindowcontrol each and every pagewindowcontrol using the Tools-gtObject Identification using the Tools-gtObject Identification dialog (Recording)dialog (Recording)Another way to disable SI File -gt Another way to disable SI File -gt Settings -gt Run -gt Check the Disable Settings -gt Run -gt Check the Disable Smart Identification during run Smart Identification during run session check box (Run-Time)session check box (Run-Time)

QTP EnvironmentQTP Environment

Windows Windows

1048707104870710487071048707C++ Visual Basic Java NETC++ C++ Visual Basic Java NETC++ NETNET

WebWeb

1048707104870710487071048707Web Applications Web services Web Applications Web services FlashFlash

Other technologiesOther technologies

1048707104870710487071048707SAP Siebel Oracle Peoplesoft SAP Siebel Oracle Peoplesoft ActiveXActiveX

Add-In architectureAdd-In architecture

Enables QTP to provide support for Enables QTP to provide support for multiple technologiesmultiple technologiesAdd-ins are software that need to Add-ins are software that need to be installed on a system that has be installed on a system that has QTP QTP It then becomes integrated with It then becomes integrated with the QTP environmentthe QTP environment

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 25: Qtp day 1

QTP EnvironmentQTP Environment

Windows Windows

1048707104870710487071048707C++ Visual Basic Java NETC++ C++ Visual Basic Java NETC++ NETNET

WebWeb

1048707104870710487071048707Web Applications Web services Web Applications Web services FlashFlash

Other technologiesOther technologies

1048707104870710487071048707SAP Siebel Oracle Peoplesoft SAP Siebel Oracle Peoplesoft ActiveXActiveX

Add-In architectureAdd-In architecture

Enables QTP to provide support for Enables QTP to provide support for multiple technologiesmultiple technologiesAdd-ins are software that need to Add-ins are software that need to be installed on a system that has be installed on a system that has QTP QTP It then becomes integrated with It then becomes integrated with the QTP environmentthe QTP environment

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 26: Qtp day 1

Add-In architectureAdd-In architecture

Enables QTP to provide support for Enables QTP to provide support for multiple technologiesmultiple technologiesAdd-ins are software that need to Add-ins are software that need to be installed on a system that has be installed on a system that has QTP QTP It then becomes integrated with It then becomes integrated with the QTP environmentthe QTP environment

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 27: Qtp day 1

Add-In architectureAdd-In architecture

QTP is sold with the ability to QTP is sold with the ability to understand a few technologies add-ins understand a few technologies add-ins provide QTP with the ability to provide QTP with the ability to understand additional technologiesunderstand additional technologiesUsers are able to select the specific Users are able to select the specific add-ins for the technologies they are add-ins for the technologies they are testing thereby reducing the memorytesting thereby reducing the memoryfootprint of QTPfootprint of QTP

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 28: Qtp day 1

Add-In architectureAdd-In architecture

When QTP is started you should When QTP is started you should select only the add-ins for select only the add-ins for technologies that are used with your technologies that are used with your applicationapplicationSome of the available add-ins are Some of the available add-ins are ActiveX - For testing software written ActiveX - For testing software written using ActiveX (also known as COM) using ActiveX (also known as COM) technology This technology allows technology This technology allows people to create objects in one people to create objects in one language and use those objects within language and use those objects within other languagesapplicationsother languagesapplications

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 29: Qtp day 1

Add-In architectureAdd-In architecture

Visual Basic - For applications written Visual Basic - For applications written in the Visual Basic languagein the Visual Basic languageWeb - For testing web applications Web - For testing web applications written in any language In web written in any language In web applications we interact with the applications we interact with the application though a web browser and application though a web browser and so the web application can be written so the web application can be written in any languagein any language

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 30: Qtp day 1

Recording for webRecording for web

QTP Option SettingsQTP Option Settings

ToolsgtOptions ToolsgtOptions displays the displays the options dialog box Here the Web options dialog box Here the Web tab options determine QTPs tab options determine QTPs behavior when recording and behavior when recording and running tests or components on running tests or components on Web sitesWeb sites

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 31: Qtp day 1

Run and AnalyzeRun and Analyze

When you run your test QuickTest When you run your test QuickTest opens the appropriate application opens the appropriate application or or Web site and performs each step as Web site and performs each step as it was originally recorded in the it was originally recorded in the test test When QuickTest finishes running the When QuickTest finishes running the test it displays the results of the test it displays the results of the run run

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 32: Qtp day 1

Run and AnalyzeRun and Analyze

Running a TestRunning a Test Start QuickTest and open the Start QuickTest and open the Recording testRecording test If QuickTest is not already open If QuickTest is not already open choose choose Start gt Programs gt Start gt Programs gt QuickTest QuickTest Professional gt QuickTest Professional gt QuickTest ProfessionalProfessional

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 33: Qtp day 1

Run and AnalyzeRun and Analyze

If the Welcome window opens If the Welcome window opens click click Open ExistingOpen Existing If QuickTest opens without If QuickTest opens without displaying the Welcome window displaying the Welcome window choosechooseFile gt OpenFile gt Open or click or click the the OpenOpen button buttonIn the Open TestIn the Open Test dialog box locate dialog box locate and select the and select the RecordingRecording test test then click then click OpenOpen

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 34: Qtp day 1

Run and AnalyzeRun and AnalyzeAnalyzing Test ResultsAnalyzing Test Results When QuickTest finishes running the test the Test When QuickTest finishes running the test the Test Results window opensResults window opensQuickTest Professional (QTP) gives an excellent QuickTest Professional (QTP) gives an excellent feature to view the results summary and ability to feature to view the results summary and ability to drilldown to the level of each objectdrilldown to the level of each objectBy default after every execution test results window By default after every execution test results window gets opened and we can see the Test Results gets opened and we can see the Test Results Summary This window shows the followingSummary This window shows the followingName of the testName of the testTime zoneTime zoneRun started timeRun started timeRun end timeRun end timeIterationIterationStatus (Passed Failed Warnings)Status (Passed Failed Warnings)

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 35: Qtp day 1

Run and AnalyzeRun and Analyze

When the execution is initialized (by either When the execution is initialized (by either clicking Run or pressing F5) a popup comes and clicking Run or pressing F5) a popup comes and shows two options as in the below figureshows two options as in the below figure

New run results folderNew run results folderTemporary results folderTemporary results folderThe first option creates a new folder for every run The first option creates a new folder for every run

where the second one will write the results into a where the second one will write the results into a temporary folder which gets overwritten next temporary folder which gets overwritten next time Usually if we want to store the results then time Usually if we want to store the results then select the first option otherwise if you are select the first option otherwise if you are executing the test for debugging purpose select executing the test for debugging purpose select the second one If you are executing the test the second one If you are executing the test multiple times for debugging purpose then it is multiple times for debugging purpose then it is better to select the second option otherwise the better to select the second option otherwise the QTP unnecessarily creates too many results QTP unnecessarily creates too many results folders folders

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 36: Qtp day 1

Run and AnalyzeRun and AnalyzeFollow the below steps to arrive at the Test Follow the below steps to arrive at the Test

Results windowResults windowOpen the test ndash InsertNewOrder Open the test ndash InsertNewOrder (Click on Run or press F5)(Click on Run or press F5)Select the second option Temporary run results Select the second option Temporary run results

folderfolderClick OKClick OKQTP executes the test and opens the Results QTP executes the test and opens the Results

window by defaultwindow by defaultIf Results window does not open then Go to If Results window does not open then Go to

Automation menu ndashgt click Results optionAutomation menu ndashgt click Results optionGo through the Test ResultsGo through the Test Results

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 37: Qtp day 1

Run and AnalyzeRun and Analyze

After the execution of any test After the execution of any test scenario a test automation scenario a test automation engineer needs to know engineer needs to know whether all the steps are whether all the steps are passed If any test step is failed passed If any test step is failed then we can find out the action then we can find out the action (ie click select navigation (ie click select navigation etc) in Test Results tree etc) in Test Results tree

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 38: Qtp day 1

Run and AnalyzeRun and Analyze

Click the plus symbol (+) on the Click the plus symbol (+) on the Test Results tree and drilldown Test Results tree and drilldown to the level of object (ie to the level of object (ie button edit box dropdown button edit box dropdown etc) For each action we can etc) For each action we can see the description such as see the description such as Object Time Details Result Object Time Details Result etc etc

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 39: Qtp day 1

Run and AnalyzeRun and Analyze

Analyzing Test ResultsAnalyzing Test Results

When QuickTest finishes running When QuickTest finishes running the test the Test Results window the test the Test Results window opensopens

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 40: Qtp day 1

QTP ComponentsQTP Components

QTP (QuickTest Professional) lets you QTP (QuickTest Professional) lets you create tests and business components by create tests and business components by recording operations as you perform them recording operations as you perform them in your applicationin your applicationTest - A compilation of steps organized Test - A compilation of steps organized into one or more actions which we can into one or more actions which we can use to verify that our application performs use to verify that our application performs as expected A test is composed of actions as expected A test is composed of actions (3 kinds of actions are there in QTP Non-(3 kinds of actions are there in QTP Non-reusable action Reusable action and reusable action Reusable action and External action)External action)

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 41: Qtp day 1

QTP ComponentsQTP Components

First step is PlanningFirst step is Planning

Before starting to build a test you Before starting to build a test you should plan it and prepare the should plan it and prepare the required infrastructurerequired infrastructure

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 42: Qtp day 1

QTP ComponentsQTP Components

For example determine the For example determine the functionality you want to test short functionality you want to test short tests that check specific functions tests that check specific functions of the application or complete siteof the application or complete site

Decide how you want to organize Decide how you want to organize your object repositoriesyour object repositories

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 43: Qtp day 1

QTP ComponentsQTP ComponentsSecond step in QTP is Creating Tests or Second step in QTP is Creating Tests or ComponentsComponentsWe can create a test or component byWe can create a test or component bya) Either recording a session on your a) Either recording a session on your application or Web siteapplication or Web siteAs we navigate through the application or site As we navigate through the application or site QuickTest graphically displays each step we QuickTest graphically displays each step we perform as a row in the Keyword View The perform as a row in the Keyword View The DocumentationDocumentationcolumn of the Keyword View also displays a column of the Keyword View also displays a description of each step in easy to understand description of each step in easy to understand sentences A step is something that causes or sentences A step is something that causes or makes a change in your site or application makes a change in your site or application such as clicking a link or image or submitting such as clicking a link or image or submitting a data forma data form

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 44: Qtp day 1

QTP ComponentsQTP Components

b) Build an object repository b) Build an object repository and use these objects to add and use these objects to add steps manually in the Keyword steps manually in the Keyword View or Expert View We can View or Expert View We can then modify your test or then modify your test or component withcomponent withspecial testing options andor special testing options andor with programming statementswith programming statements

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 45: Qtp day 1

QTP ComponentsQTP Components

Third step isThird step is

Inserting checkpoints into your test or Inserting checkpoints into your test or componentcomponent

A checkpoint is a verification point that A checkpoint is a verification point that compares a recent value for a specified compares a recent value for a specified property with the expected value for that property with the expected value for that property This enables you to identify property This enables you to identify whether the Web site or application is whether the Web site or application is functioning correctlyfunctioning correctly

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 46: Qtp day 1

QTP ComponentsQTP Components

Fourth step isFourth step isBroaden the scope of your test or Broaden the scope of your test or component by replacing fixed values with component by replacing fixed values with parametersparametersTo check how your application performs the To check how your application performs the same operations with different data you can same operations with different data you can parameterize your test or componentparameterize your test or componentWhen you parameterize your test or When you parameterize your test or component QuickTest substitutes the fixed component QuickTest substitutes the fixed values in your test or component with values in your test or component with parametersparametersEach run session that uses a different set of Each run session that uses a different set of parameterized data is called an iterationparameterized data is called an iteration

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 47: Qtp day 1

QTP ComponentsQTP Components

We can also use output values to extract We can also use output values to extract data from our test or component An output data from our test or component An output value is a value retrieved during the run value is a value retrieved during the run session and entered into the Data Table or session and entered into the Data Table or saved as a variable or a parameter We can saved as a variable or a parameter We can subsequently use this output value as input subsequently use this output value as input data in your test or componentdata in your test or componentWe can use many functional testing We can use many functional testing features of QuickTest to improve your test features of QuickTest to improve your test or component andor add programming or component andor add programming statements to achieve more complex statements to achieve more complex testing goalstesting goals

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 48: Qtp day 1

QTP ComponentsQTP Components

Fifth step is running the testFifth step is running the testAfter creating test or component we run itAfter creating test or component we run itRun test or component to check the site or Run test or component to check the site or applicationapplicationWhen we run the test or component When we run the test or component QuickTest connects to your Web site or QuickTest connects to your Web site or application and performs each operation in application and performs each operation in a test or component checking any text a test or component checking any text strings objects or tables you specified If strings objects or tables you specified If we parameterized the test with Data Table we parameterized the test with Data Table parameters QuickTest repeats the test (or parameters QuickTest repeats the test (or specific actions in your test) for each set of specific actions in your test) for each set of data values we defineddata values we definedRun the test or component to debug itRun the test or component to debug it

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 49: Qtp day 1

QTP ComponentsQTP Components

We can control the run session to identify We can control the run session to identify and eliminate defects in the test or and eliminate defects in the test or component We can use the Step Into Step component We can use the Step Into Step Over And Step Out commands to run a Over And Step Out commands to run a test or component step by steptest or component step by stepWe can also set breakpoints to pause the We can also set breakpoints to pause the test or component at pre-determined test or component at pre-determined pointspointsWe can view the value of variables in the We can view the value of variables in the test or component each time it stops at a test or component each time it stops at a breakpoint in the Debug Viewerbreakpoint in the Debug Viewer

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 50: Qtp day 1

QTP ComponentsQTP Components

Sixth step is analyzing the resultsSixth step is analyzing the resultsAfter we run test or component we can view the After we run test or component we can view the resultsresultsView the results in the Results windowView the results in the Results windowAfter running the test or component we can view After running the test or component we can view the results of the run in the Test Results window the results of the run in the Test Results window We can view a summary of the results as well as a We can view a summary of the results as well as a detailed reportdetailed reportReport defects identified during a run sessionReport defects identified during a run sessionIf Quality Center is installed we can report the If Quality Center is installed we can report the defects fond out to a databasedefects fond out to a databaseWe can instruct QuickTest to automatically report We can instruct QuickTest to automatically report each failed step in the test or component or we each failed step in the test or component or we can report them manually from the Test Results can report them manually from the Test Results windowwindow

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 51: Qtp day 1

Object SpyObject Spy

Object Spy Enhancements in 100Object Spy Enhancements in 1001 Object spy to have an option to 1 Object spy to have an option to export all the objects in hierarchy export all the objects in hierarchy with their properties and methods with their properties and methods to a XLS XML file And also to have to a XLS XML file And also to have an option to reload this offline This an option to reload this offline This feature would help for others to feature would help for others to analyze a object recognition analyze a object recognition remotelyremotely

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 52: Qtp day 1

Object SpyObject Spy

2 Object spy to have the ability to 2 Object spy to have the ability to run without QTP Currently object spy run without QTP Currently object spy can only be loaded through QTPcan only be loaded through QTP

3 Object spy to have an option to 3 Object spy to have an option to disable the Auto spy Currently disable the Auto spy Currently hovering on any object displays it hovering on any object displays it properties without the need to click properties without the need to click the object This at time gives poor the object This at time gives poor performance while spying objectsperformance while spying objects

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 53: Qtp day 1

Object SpyObject Spy

4 Currently Object Spy button gets 4 Currently Object Spy button gets disabled when the script is run one disabled when the script is run one has to launch object repository and has to launch object repository and then launch Object Spy fromthen launch Object Spy fromthere The Object Spy should enable there The Object Spy should enable directly when the script is rundirectly when the script is run5 Object Spy Automation capability 5 Object Spy Automation capability so other tools can leverage the same so other tools can leverage the same and automate the OR creation based and automate the OR creation based on custom ruleson custom rules

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 54: Qtp day 1

Object SpyObject Spy

6 Object spy to have capability to 6 Object spy to have capability to spy on dynamically created objects spy on dynamically created objects Eg ndash The search suggestion box on Eg ndash The search suggestion box on GoogleGoogle7 Object Spy to have facility to 7 Object Spy to have facility to compare two different objects and compare two different objects and show the differencesshow the differences8 Object Spy to support XPaths for 8 Object Spy to support XPaths for identifying objectsidentifying objects

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 55: Qtp day 1

Object SpyObject Spy

QTP 11 Object Spy has been QTP 11 Object Spy has been improved now with following featuresimproved now with following features

Add an object to a repository Add an object to a repository

Highlight an object in your Highlight an object in your applicationapplication

Copypaste object propertiesCopypaste object properties

Add an object to a repository Add an object to a repository

You can now add an object to the You can now add an object to the object repository directly from the object repository directly from the Object SpyObject Spy

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 56: Qtp day 1

Object SpyObject Spy

Highlight an object in your Highlight an object in your application When you select a test application When you select a test object in the Object Spy Object object in the Object Spy Object hierarchy tree you can then select to hierarchy tree you can then select to highlight the object in your highlight the object in your application that corresponds to that application that corresponds to that test objecttest object

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 57: Qtp day 1

Object SpyObject Spy

Copypaste object properties You can Copypaste object properties You can copy the identification properties and copy the identification properties and values of a selected test object in the values of a selected test object in the Object Spy and paste the details into any Object Spy and paste the details into any document The details are formatted in document The details are formatted in programmatic description syntax This programmatic description syntax This option is especially useful if you want to option is especially useful if you want to compare the properties and values of two compare the properties and values of two objects in your application or when objects in your application or when creatingcreating

programmatic descriptionsprogrammatic descriptions

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 58: Qtp day 1

Object RepositoryObject Repository

Object Repository is a place Object Repository is a place where QTP stores learned where QTP stores learned objects objects QTP uses default Object QTP uses default Object Identification properties Identification properties mandatory and assistive to mandatory and assistive to learn objects into ORlearn objects into OR

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 59: Qtp day 1

Object RepositoryObject Repository

Creating an Object Repository Creating an Object Repository

Per Action An object repository is Per Action An object repository is created for each actioncreated for each action

This means that multiple object This means that multiple object repositories can be created per testrepositories can be created per test

Shared A single objected repository Shared A single objected repository is used for multiple testsis used for multiple tests

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 60: Qtp day 1

Object RepositoryObject Repository

What is Object Repository in QTPWhat is Object Repository in QTPObject repository in QTPObject repository in QTPObject repository is the heart of QTP if you Object repository is the heart of QTP if you donrsquot understand it properly than you will donrsquot understand it properly than you will face lots of problems in developing and face lots of problems in developing and testing of your applicationtesting of your applicationPlease keep in mind following points Please keep in mind following points regarding object repositoryregarding object repository- Test objects can be saved in two types of - Test objects can be saved in two types of object repositoryobject repositoryLocal object repository and Shared object Local object repository and Shared object repositoryrepository

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 61: Qtp day 1

Object RepositoryObject Repository

- A local object repository stores - A local object repository stores objects in a file that is associated objects in a file that is associated with one specific action so that with one specific action so that only that action can access the only that action can access the stored objectsstored objects

- A shared object repository - A shared object repository stores test objects in a file that stores test objects in a file that can be accessed by multiple can be accessed by multiple teststests

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 62: Qtp day 1

Object RepositoryObject Repository

- When you want to create test (New - When you want to create test (New project) you have two ways to store project) you have two ways to store the objects in your testthe objects in your test

- Store the objects in corresponding - Store the objects in corresponding local object repository ORlocal object repository OR

- Store the objects in one or more - Store the objects in one or more Shared object repository Shared object repository (Smart advanced and efficient way) (Smart advanced and efficient way) because it reduces maintenance and because it reduces maintenance and enhance reusability of your testsenhance reusability of your tests

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 63: Qtp day 1

Object RepositoryObject Repository

Script playback using ORScript playback using OR

QTP finds the Object in Object QTP finds the Object in Object Repository using object Logical Name Repository using object Logical Name and Object Hierarchyand Object Hierarchy

QTP retrieves Test Object properties QTP retrieves Test Object properties from ORfrom OR

QTP searches actual application for QTP searches actual application for the Object with the same properties the Object with the same properties as the OR Test Object and performs as the OR Test Object and performs user actionuser action

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 64: Qtp day 1

Object RepositoryObject Repository

TO RO and Object TO RO and Object

GetTOpropertySetToProperty refers GetTOpropertySetToProperty refers to the properties stored in ORto the properties stored in OR

GetROProperty property refers to GetROProperty property refers to the AUT Object property (Run-time)the AUT Object property (Run-time)

Objectltpropertymethodgt refers to Objectltpropertymethodgt refers to the AUT Object the AUT Object NATIVENATIVE propertiesmethodspropertiesmethods

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 65: Qtp day 1

Object RepositoryObject Repository

PROSPROSGUI Front end to examine all the GUI Front end to examine all the objects in the repositoryobjects in the repositoryHighlight in Application feature is Highlight in Application feature is great tool to walk the object treegreat tool to walk the object treeNo need to modify the script when No need to modify the script when object properties changesobject properties changesEasy to identify objects in AUT by Easy to identify objects in AUT by Object Logical namesObject Logical namesCan be created independently from Can be created independently from scriptsscripts

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 66: Qtp day 1

Object RepositoryObject Repository

CONSCONSAdditional layer to maintainAdditional layer to maintainUnnecessary objects can be Unnecessary objects can be createdcreatedMultiple users cannot Multiple users cannot concurrently save write to the concurrently save write to the shared ORshared ORIt wonrsquot eliminate the need for It wonrsquot eliminate the need for Descriptive Programming in Descriptive Programming in most of casesmost of cases

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 67: Qtp day 1

QTP ContinuedQTP Continued

Day2 Day2

QTP FeaturesQTP Features

Synchronization pointsSynchronization points

Modes of RecordingModes of Recording

CheckpointsCheckpoints

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 68: Qtp day 1

QTP ContinuedQTP Continued

Day3 Day3

Advanced FeaturesAdvanced Features

ParameterizationParameterization

Step GeneratorStep Generator

Adding conditional statementsAdding conditional statements

Custom checkPointsCustom checkPoints

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 69: Qtp day 1

QTP ContinuedQTP Continued

Day4 Day4

Advanced FeaturesAdvanced Features

Report and CommentReport and Comment

Splitting ActionSplitting Action

Virtual objectVirtual object

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects

Page 70: Qtp day 1

QTP ContinuedQTP Continued

Day5 Day5

Advanced QTPAdvanced QTP

Recovery scenarioRecovery scenario

Optional stepsOptional steps

Framework ApproachFramework Approach

Working with Dynamic ObjectsWorking with Dynamic Objects