Qtp day 1


Published on

Published in: Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Qtp day 1

  1. 1. QTP
  2. 2. Day1: Intro to QTPWhat is QTP?Features of QTPObjectsQTP EnvironmentAdd-In architectureRecording for webRun and AnalyzeQTP ComponentsObject SpyObject Repository
  3. 3. What is QTP?Q uickT est P rofessional, popularlyknown by its acronym QTP is anautomation testing tool originallyfrom Mercury Interactive whichwas acquired by Hewlett Packard(HP) in 2006. QTP is primarilyused for functional and regressionautomated testing.
  4. 4. What is QTP?Using QTP, you can automate useractions on a web or client basedcomputer application and test the sameactions for different users, different dataset, on various Windows operatingsystems and/or different browsers.Automation using QTP if planned andexecuted in a proper manner can saveconsiderable time and money.
  5. 5. What is QTP?QTP is one of the most widelyused automation testing tools inthe market today with over 60%market share. Due to this reason,skilled QTP professionals arealways in demand.
  6. 6. Features of QTP1. A great set of new Quality Center 10.00 integration abilities are there in QuickTest Professional 10.0. Integration abilities such as:-You can maintain asset versioning and baselines.There is an Asset Comparison Tool for comparing versions of individual QTP assets.
  7. 7. Features of QTPIt also includes an Asset Viewer for viewing an earlier version of a QTP asset and much more such as tool to upgrade all QuickTest assets to use these new features etc.[QuickTest assets include tests, components, application areas, and the resources associated with them, such as shared object repositories, function libraries, recovery scenarios, and external data tables.]
  8. 8. Features of QTP2. You can use the File > Save Test with Resources command to save a standalone, local copy of your test with all associated resource files and any called actions. This perks up portability.
  9. 9. Features of QTP3. LoadAndRunAction statement helps you load and run an action only when the step runs so that these actions are not loaded each time you open a test.
  10. 10. Features of QTP4. You can centrally manage your work items and ToDo tasks in the To Do Pane, which enables you to create and control self- defined tasks, and to view a compiled set of the TODO comments from your tests, associated function libraries and components.
  11. 11. Features of QTP5. You can now develop your own algorithm to compare bitmap checkpoints. A custom comparer is an object that performs the bitmap comparison for the checkpoint according to your testing requirements. QuickTest then receives and reports the results that the custom comparer returns.
  12. 12. Features of QTP6. There are also some improvements in the Test Result Analysis e.g. QuickTest run results can now be exported to MS Word and PDF format, use of an image file as a fourth argument to Reporter.ReportEvent method, select jump to Step in QuickTest when you right click any node in test results to show that step within the QuickTest testing document, run results for tests and components that are run as part of a Quality Center test set now include the Quality Center server and project name etc.
  13. 13. Features of QTP7. The new Delphi Add-in enables you to test Win32 VCL Delphi controls.8. File > Settings > Local System Monitor enables you to monitor the local (clientside) computer resources used by the application instance you are testing during a run session.There are some feature enhancements also like:-You can upgrade from QTP 9.5 to QTP 10 without uninstalling QTP 9.5 first.IntelliSense functionality is improved.Design and functionality of a debugger pane is improved.Maintenance Run mode now includes new Object Identification Solutions.Added Control for Editing and Managing Actions in Automation Scripts.A new look for some dialog boxes.An improved Web Add-in Extensibility and much more.
  14. 14. Features of QTP8. File > Settings > Local System Monitor enables you to monitor the local (clientside) computer resources used by the application instance you are testing during a run session.
  15. 15. Features of QTPThere are some feature enhancements also like:-You can upgrade from QTP 9.5 to QTP 10 without uninstalling QTP 9.5 first.IntelliSense functionality is improved.Design and functionality of a debugger pane is improved.
  16. 16. Features of QTPMaintenance Run mode now includes new Object Identification Solutions.Added Control for Editing and Managing Actions in Automation Scripts.A new look for some dialog boxes.An improved Web Add-in Extensibility and much more.
  17. 17. Features of QTPXPath and CSS based object identificationGood Looking and Enhanced ResultsViewerEasy Regular ExpressionsNow identify objects not only in relation toeach other but in relation to neighboringobjects.Load Function Libraries at Run TimeTest Your GUI and UI-Less ApplicationFunctionality in One TestRecord SupportMuch Awaited Log Tracking is available
  18. 18. ObjectsObjects are GUI entities, qualified withsome properties, data and the methodsnecessary to operate on that data.Property describes the object defined,which differentiates the given object withother objects.Methods are functions, required in order tomanipulate the object properties.
  19. 19. ObjectsExample: A Button is said to be anobject which consists of propertiessuch as ‘Enabled’, ‘Size’ and methodssuch as ‘onClick’, ‘OnFocus’ etc.
  20. 20. ObjectsProperties - These are characteristicsof the object e.g. the text on a button.QTP uses this to recognize theobject.
  21. 21. ObjectsMethods - These are built infunctionality of the object. The VBScriptcode that we write (or record) actuallymakes calls to the methods of an objecte.g. Reporter.ReportEvent(). HereReportEvent is the method of theReporter object.
  22. 22. ObjectsEvents - These are what can bedone to an object. This is used byprogrammers to determine what anobject does in response to anaction you perform. It is howeverunused in QTP.
  23. 23. ObjectsQTP Object Identification ProcessObject Identification: The tool determines whatproperties of objects are recorded.Object Spy: Allows users to view the property ofan object without recording it.Object Repository: Holds information recordedabout each object allowing the test to identifythe object during execution.
  24. 24. ObjectsObject Smart IdentificationSmart Identification is not ArtificialIntelligenceSI uses loose/unreliable object recognitionIt’s recommended to disable SI for each andevery page/window/control using the Tools->Object Identification dialog (Recording)Another way to disable SI: File -> Settings-> Run -> Check the "Disable SmartIdentification during run session" check box(Run-Time)
  25. 25. QTP EnvironmentWindows: 􀂃􀂃C++, Visual Basic, Java, .NETC++, NETWeb: 􀂃􀂃Web Applications, Web services, FlashOther technologies: 􀂃􀂃SAP, Siebel, Oracle, Peoplesoft,ActiveX
  26. 26. Add-In architectureEnables QTP to provide support formultiple technologies.Add-ins are software that need to beinstalled on a system that has QTP.It then becomes integrated with theQTP environment.
  27. 27. Add-In architectureQTP is sold with the ability to understand afew technologies, add-ins provide QTP withthe ability to understand additionaltechnologies.Users are able to select the specific add-insfor the technologies they are testing therebyreducing the memoryfootprint of QTP
  28. 28. Add-In architectureWhen QTP is started, you should selectonly the add-ins for technologies that areused with your application.Some of the available add-ins areActiveX - For testing software written usingActiveX (also known as COM) technology.This technology allows people to createobjects in one language and use thoseobjects within other languages/applications.
  29. 29. Add-In architectureVisual Basic - For applications written in theVisual Basic language.Web - For testing web applications writtenin any language. In web applications, weinteract with the application though a webbrowser and so the web application can bewritten in any language.
  30. 30. Recording for webQTP Option SettingsTools>Options displays the optionsdialog box. Here the Web tab optionsdetermine QTPs behavior whenrecording and running tests orcomponents on Web sites.
  31. 31. Run and AnalyzeWhen you run your test, QuickTest opensthe appropriate application or Web site and performs each step as itwas originally recorded in the test. When QuickTest finishes running thetest, it displays the results of the run.
  32. 32. Run and AnalyzeRunning a TestStart QuickTest and open theRecording test.If QuickTest is not already open,choose Start > Programs >QuickTest Professional > QuickTestProfessional .
  33. 33. Run and AnalyzeIf the Welcome window opens,click Open Existing .If QuickTest opens without displayingthe Welcome window, chooseFile > Open  or click the Open  button.In the Open Test  dialog box, locate andselect the Recording  test, thenclick Open .
  34. 34. Run and AnalyzeAnalyzing Test ResultsWhen QuickTest finishes running the test, the Test Resultswindow opens.QuickTest Professional (QTP) gives an excellent feature toview the results summary and ability to drilldown to the levelof each object.By default after every execution test results window getsopened and we can see the Test Results Summary. Thiswindow shows the following:Name of the testTime zoneRun started timeRun end timeIterationStatus (Passed, Failed, Warnings)
  35. 35. Run and AnalyzeWhen the execution is initialized (by either clicking Run or pressing F5), a popup comes and shows two options as in the below figure.New run results folderTemporary results folderThe first option creates a new folder for every run where the second one will write the results into a temporary folder, which gets overwritten next time. Usually, if we want to store the results then select the first option otherwise if you are executing the test for debugging purpose select the second one. If you are executing the test multiple times for debugging purpose, then it is better to select the second option, otherwise the QTP unnecessarily creates too many results folders. 
  36. 36. Run and AnalyzeFollow the below steps to arrive at the Test Results window:Open the test – InsertNewOrder(Click on Run or press F5)Select the second option / Temporary run results folderClick OKQTP executes the test and opens the Results window by default.If Results window does not open then Go to Automation menu –> click Results optionGo through the Test Results.
  37. 37. Run and AnalyzeAfter the execution of any test scenario, a test automation engineer needs to know whether all the steps are passed. If any test step is failed then we can find out the action (i.e. click, select, navigation, etc) in Test Results tree.
  38. 38. Run and AnalyzeClick the plus symbol (+) on the Test Results tree and drilldown to the level of object (i.e. button, edit box, dropdown, etc).  For each action we can see the description such as Object, Time, Details, Result, etc.
  39. 39. Run and AnalyzeAnalyzing Test ResultsWhen QuickTest finishes running thetest, the Test Results window opens.
  40. 40. QTP ComponentsQTP (QuickTest Professional) lets you createtests and business components by recordingoperations as you perform them in yourapplication.Test - A compilation of steps organized into oneor more actions, which we can use to verify thatour application performs as expected. A test iscomposed of actions (3 kinds of actions arethere in QTP Non-reusable action, Reusableaction and External action).
  41. 41. QTP ComponentsFirst step is PlanningBefore starting to build a test, you shouldplan it and prepare the requiredinfrastructure.
  42. 42. QTP ComponentsFor example, determine the functionalityyou want to test, short tests that checkspecific functions of the application orcomplete site.Decide how you want to organize yourobject repositories.
  43. 43. QTP ComponentsSecond step in QTP is Creating Tests orComponentsWe can create a test or component bya) Either recording a session on your application orWeb site.As we navigate through the application or site,QuickTest graphically displays each step we performas a row in the Keyword View. The Documentationcolumn of the Keyword View also displays adescription of each step in easy to understandsentences. A step is something that causes or makesa change in your site or application, such as clickinga link or image, or submitting a data form.
  44. 44. QTP Componentsb) Build an object repository anduse these objects to add stepsmanually in the Keyword View orExpert View. We can then modifyyour test or component withspecial testing options and/or withprogramming statements.
  45. 45. QTP ComponentsThird step isInserting checkpoints into your test or component.A checkpoint is a verification point that compares arecent value for a specified property with theexpected value for that property. This enables youto identify whether the Web site or application isfunctioning correctly.
  46. 46. QTP ComponentsFourth step isBroaden the scope of your test or component byreplacing fixed values with parameters.To check how your application performs the sameoperations with different data you canparameterize your test or component.When you parameterize your test or component,QuickTest substitutes the fixed values in your testor component with parameters.Each run session that uses a different set ofparameterized data is called an iteration.
  47. 47. QTP ComponentsWe can also use output values to extract datafrom our test or component. An output value is avalue retrieved during the run session and enteredinto the Data Table or saved as a variable or aparameter. We can subsequently use this outputvalue as input data in your test or component.We can use many functional testing features ofQuickTest to improve your test or componentand/or add programming statements to achievemore complex testing goals.
  48. 48. QTP ComponentsFifth step is running the testAfter creating test or component, we run it.Run test or component to check the site orapplication.When we run the test or component, QuickTestconnects to your Web site or application andperforms each operation in a test or component,checking any text strings, objects, or tables youspecified. If we parameterized the test with DataTable parameters, QuickTest repeats the test (orspecific actions in your test) for each set of datavalues we defined.Run the test or component to debug it.
  49. 49. QTP ComponentsWe can control the run session to identify andeliminate defects in the test or component. Wecan use the Step Into, Step Over, And Step Outcommands to run a test or component step bystep.We can also set breakpoints to pause the test orcomponent at pre-determined points.We can view the value of variables in the test orcomponent each time it stops at a breakpoint inthe Debug Viewer.
  50. 50. QTP ComponentsSixth step is analyzing the resultsAfter we run test or component, we can view the results.View the results in the Results window.After running the test or component, we can view theresults of the run in the Test Results window. We can viewa summary of the results as well as a detailed report.Report defects identified during a run session.If Quality Center is installed, we can report the defectsfond out to a database.We can instruct QuickTest to automatically report eachfailed step in the test or component, or we can report themmanually from the Test Results window.
  51. 51. Object SpyObject Spy Enhancements in 10.0:1. Object spy to have an option to exportall the objects in hierarchy with theirproperties and methods to a XLS / XMLfile. And also to have an option to reloadthis offline. This feature would help forothers to analyze a object recognitionremotely.
  52. 52. Object Spy2. Object spy to have the ability to runwithout QTP. Currently object spy can onlybe loaded through QTP.3. Object spy to have an option to disablethe Auto spy. Currently hovering on anyobject displays it properties without theneed to click the object. This at time givespoor performance while spying objects.
  53. 53. Object Spy4. Currently Object Spy button getsdisabled when the script is run, one has tolaunch object repository and then launchObject Spy fromthere. The Object Spy should enabledirectly when the script is run.5. Object Spy Automation capability, soother tools can leverage the same andautomate the OR creation based oncustom rules.
  54. 54. Object Spy6. Object spy to have capability to spy ondynamically created objects. E.g. – Thesearch suggestion box on Google.7. Object Spy to have facility to comparetwo different objects and show thedifferences.8. Object Spy to support XPaths foridentifying objects.
  55. 55. Object SpyQTP 11 Object Spy has been improvednow with following features:Add an object to a repository.Highlight an object in your application.Copy/paste object properties.Add an object to a repository.You can now add an object to the objectrepository directly from the Object Spy.
  56. 56. Object SpyHighlight an object in your application.When you select a test object in the ObjectSpy Object hierarchy tree, you can thenselect to highlight the object in yourapplication that corresponds to that testobject.
  57. 57. Object SpyCopy/paste object properties. You can copy theidentification properties and values of a selectedtest object in the Object Spy and paste thedetails into any document. The details areformatted in programmatic description syntax.This option is especially useful if you want tocompare the properties and values of twoobjects in your application or when creatingprogrammatic descriptions.
  58. 58. Object RepositoryObject Repository is a placewhere QTP stores learnedobjects.QTP uses default ObjectIdentification properties:mandatory and assistive tolearn objects into OR.
  59. 59. Object RepositoryCreating an Object RepositoryPer Action: An object repository is createdfor each action.This means that multiple objectrepositories can be created per test.Shared: A single objected repository isused for multiple tests.
  60. 60. Object RepositoryWhat is Object Repository in QTP?Object repository in QTP:Object repository is the heart of QTP, if youdon’t understand it properly than you will facelots of problems in developing and testing ofyour application.Please keep in mind following points regardingobject repository:- Test objects can be saved in two types ofobject repositoryLocal object repository and Shared objectrepository
  61. 61. Object Repository- A local object repository storesobjects in a file that is associatedwith one specific action, so that onlythat action can access the storedobjects- A shared object repository storestest objects in a file that can beaccessed by multiple tests.
  62. 62. Object Repository- When you want to create test (Newproject) you have two ways to store theobjects in your test.- Store the objects in corresponding localobject repository OR- Store the objects in one or more Sharedobject repository. (Smart ,advanced andefficient way) because it reducesmaintenance and enhance reusability ofyour tests.
  63. 63. Object RepositoryScript playback using ORQTP finds the Object in Object Repositoryusing object Logical Name and ObjectHierarchy.QTP retrieves Test Object properties fromOR.QTP searches actual application for theObject with the same properties as the ORTest Object and performs user action.
  64. 64. Object RepositoryTO, RO and .Object.GetTOproperty/SetToProperty refers tothe properties stored in OR.GetROProperty property refers to theAUT Object property (Run-time).Object.<property/method> refers to theAUT Object NATIVE properties/methods
  65. 65. Object RepositoryPROS:GUI Front end to examine all the objectsin the repository.Highlight in Application feature is greattool to walk the object tree.No need to modify the script when objectproperties changes.Easy to identify objects in AUT by ObjectLogical names.Can be created independently fromscripts.
  66. 66. Object RepositoryCONS:Additional layer to maintainUnnecessary objects can becreated.Multiple users cannot concurrentlysave / write to the shared OR.It won’t eliminate the need forDescriptive Programming in mostof cases.
  67. 67. QTP Continued Day2:QTP FeaturesSynchronization pointsModes of RecordingCheckpoints
  68. 68. QTP Continued Day3:Advanced FeaturesParameterizationStep GeneratorAdding conditional statementsCustom checkPoints
  69. 69. QTP Continued Day4:Advanced FeaturesReport and CommentSplitting ActionVirtual object
  70. 70. QTP Continued Day5:Advanced QTPRecovery scenarioOptional stepsFramework ApproachWorking with Dynamic Objects