1 / 76

>>>>>>>>>>>>>>>>>>>>>> softwaretestinggenius <&lt

A Quick Revision of HP QTP 10.0 An Advanced Solution to Functional & Regression Test Automation Part - 1. >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<. Brief Introduction to QTP 10.0 Quick overview of QTP Life Cycle Keyword Driven Testing Approach

hectorn
Télécharger la présentation

>>>>>>>>>>>>>>>>>>>>>> softwaretestinggenius <&lt

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A Quick Revision of HP QTP 10.0 An Advanced Solution to Functional & Regression Test Automation Part - 1 >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  2. Brief Introduction to QTP 10.0 Quick overview of QTP Life Cycle Keyword Driven Testing Approach Which test cases to be automated Key Elements of QTP Recording of Scripts Playback of Scripts Managing Application Under Test Parameterization Object Repository Object Properties & Functions Data Driven Testing Approach Managing External Excel sheets Topics Covered in Part - 1 >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  3. What is QuickTest Professional10.0? QuickTest Professional 10.0 is a next-generation automated testing tool from HP, which uses the concept of keyword-driven testing to enhance the test creation and maintenance. It is a Functional and Regression testing tool, which can record the user actions, keyed in while recording and execute these user actions while we play back the test. QuickTest Professional meets the needs of both technical and non-technical users. Introduction to QuickTest Professional 10.0 >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  4. Quick Overview of QTP Life Cycle 1) Test planning 2) Generating the basic test 3) Enhancing the test 4) Debugging the test 5) Executing the test 6) Analyzing the results. >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  5. QTP Life Cycle - Test Planning Automation test lead carries out the activities like: 1) Understanding the requirements 2) Identifying the areas to be automated 3) Analyzing positive as well as negative flow of these areas 4) Preparation of automation test plan document based upon the above analysis 5) Preparations for the tool being ready with all pre configuration settings for further operations QTP Life Cycle - Generating the Basic Test Automation test engineers generate the basis test for positive as well as negative flow of the test >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  6. QTP Life Cycle - Enhancing the Test Tests can be enhanced by the following: 1) Inserting the checkpoints 2) Synchronizing the test 3) Parameterizing the test (Data Driven Testing) 4) Inserting the output values 5) Measuring transactions 6) Inserting programmatic statements 7) Inserting comments 8) Inserting the script statement manually >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  7. QTP Life Cycle - Debugging the Test It is a process of executing the script in a user desired fashion with an objective of identifying the errors. For debugging QTP offers features like 3 - Step Commands: 1) Step Into 2) Step Out 3) Step Over 1 - Break Point: For breaking the execution temporarily >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  8. QTP Life Cycle - Executing the Test In this phase testers execute the Test QTP Life Cycle - Analyzing the Test In this phase testers do the analysis of the Results >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  9. Keyword Driven Testing Approach • Keyword-driven testing is a technique which differentiates most of the programming effort from the actual steps in testing so that these steps can be developed earlier and can be maintained with only minor updates, even when the application undergoes significant changes. • With this approach, testing engineers are able to make full utilization of test and object properties, through an integrated scripting and debugging environment fully synchronized with the Table Based Keyword View or in the VBScript-based Expert View. >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  10. When we have a large number of test cases, we have to carefully analyze them and group them into categories and then decide if that test case should executed on every release/build of the application or not. If the test case is not intended to be executed on every release it should not be automated since it falls into a one-time" testing category. Identification of test cases to be automated >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  11. Some test cases might be very time consuming to automate where as executing them manually could be just a matter of 5 to 10 minutes. Such type of test cases should be given the least priority in terms of when to automate them. Some test cases may have manual intervention for example: when we create an account in the application someone in our team has to run some batch processes manually in order for us to continue with further testing. These kind of test cases should not be automated unless we have full control of the backend processes to be run for successful completion of the test using QTP. Identification of test cases to be automated >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  12. QTP has two main components: a) VB Script Language b) Object RepositoriesWhile recording the user actions on the applications QTP will generate the VB Script statements, which indicate the actions it is supposed to perform. While recording, QTP will also learn the objects present in the application, say for example a Window, check box, radio button etc., and stores these objects in a place called Object Repository. In order to run the test successfully the corresponding object should exist in the Object Repository. Key Elements of QTP >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  13. Different modes of Recording in QTP There are three modes Context Sensitive Mode Low Level Mode Analog Mode. Recording of Scripts >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  14. Context Sensitive Mode:In this mode QTP records the objects and properties of the objects from the application so that it can identify them while playing back the script. 99% of testing is done with the help of context sensitive mode.Analog mode: This mode isused for recording the continuous operations. In this mode QTP records the mouse movements and key strokes on the keyboard as Tracks so that it can help us in testing the situations like signature scanning or handwriting or drawing some objects on the screen or in a window etc. Recording Modes in QTP >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  15. Low Level Recording Mode: It is a special mode available in QTP that is used for recording the minimum operations on the Non-Supported environments as well. In this mode QTP records the objects based on their location by capturing the X and Y coordinates of the objects on the screen. The Analog and Low Level recording modes can be selected only after hitting the record button. In the picture below the First icon is for Analog recording and the second one is for Low Level recording. Analog and Low Level Recording modes can only be selected after starting to Record and going to the Automation menu. Recording Modes in QTP >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  16. Different Modes of Executing Tests in QTPThere are three modes of replaying the test. These are not listed on the tool bar.When we hit the “Run” button we get the "Run" dialogue box, which gives us two options.1) To save the results in New run results folder. This is the Verify mode.2) To save the results in Temporary run results folder overwriting the earlier results. This is the Debug mode.3) When we need to run the test to update the Checkpoints go to Automation" menu and select "Update Run Mode". Playback of QTP Scripts >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  17. Verify Mode: If the test engineer wants to save the results of the test run to compare and verify with the future runs of the same test he would go with the verify mode. Debug Mode: If the Test engineer does not want to save the results as he is yet to finish the script or he is testing his QTP coding logic he would run the test in the debug mode. Update Mode: If a test engineer wants to update the expected results while running the test, say for example while recording the script the calendar date was 10/20/2008 and while executing the test it is a different date (system date), then the test should be run in the update mode otherwise the test would fail because of the changed properties of the object. Playback of QTP Scripts >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  18. 1) QTP's inbuilt interpreter checks for the syntax errors in the script. 2) It checks to see if the object specified in the script exists in the repository. 3) It checks if the object specified in the script exists on the ApplicationUnder Test. 4) Does the action / task specified in the script. During script execution if any of the above phases encounter the error, then an error window pops up depending on the situation. Activities During QTP Script’s Play Back >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  19. Syntax Error Error Messages During Script Play Back >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  20. Object not found in the repository Error Messages During Script Play Back >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  21. Objects exists in the repository but is not displayed on the screen Error Messages During Script Play Back >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  22. Managing Application Under Test How to start the Application Under Test? If we are working with just one application If we are working with multiple applications >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  23. In QTP we can specify the URL for the application or the exe file of the application within the settings. Go to "Automation" menu and select "Record and Run Settings" option. It opens a Record and Run settings dialogue box, which has options to enter the URL of the application for web or exe file of the application if it is windows application. Working with just one application >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  24. For the main test, which calls the reusable actions, we can use the option "Open the following browser when a record or run session begins". Once the application is open we don't need to open the application again so for all the reusable action we can use the option "Record and run test on any open Web browses". But we should make sure that all the browsers except Quality Center are closed before recording or running the tests. For windows applications we can select the application by clicking the "Add" button and browsing the 0065xecutable file of the application. Working with just one application >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  25. Working with just one application >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  26. Working with Multiple applications • At workplace usually we will be working with more than one application and we might need to automate the test cases for these applications. In this situation we should select the Radio button "Record and run test on any windows based application" for non web based application or "record and run test on any open browsers" for web applications which will instruct QTP not to open any application by itself. Then we need to include the statement SysternUtil.Run in the Login script /Action and execute that as the first action in the flow of actions.Example: SystemUtil.Run www.softwaretestinggenius.com >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  27. Working with Multiple applications Or if it is a windows based application we have to give the path of the executable. SystemUtil.Run "C..\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe'' What statement would we use to send the results to the test results? We would use Reporter. Reportevent followed by the step name, description and result to send the result to the test results and get the status whether the step passed or failed.Example:Reporter. ReportEvent 0,"Property Check", "Property Checked Passed”Value "0" indicates that the step is passed and "1" indicates that the step is failed. We can also use micPass or micFail in place of 0 or 1. >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  28. What is ParameterizationIt is a processby which we canexpand the scope of our basic test by replacing fixed values with parameters. This process, greatly increases the power and flexibility of our tests. In other words it is a way of data entry into the application without hard coding the values within the test script. We have following ways to parameterize Using values from Data Table Using Environment Variables Using Random Numbers generated Using Test Parameters Using Action Parameters Parameterization >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  29. Manual Parameterization In order to avoid the several navigation steps we can directly do manual parameterization For Example: A = data table (“V1”,1) Vbwindow (“form1”). Vbedit (“val1”). Set a. Vbwindow (“form1”). Vbedit (“val2”). Set data table (“v2”, 1) Vbwindow (“form1”). Vbbutton (“Add”). Click Parameterization >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  30. What are the standard Object classes? Developers assign properties to each object on the application. Object class is an industry standard to identify a particular type of object in the application and some of the commonly used standard classes are: Parameterization 1) Window2) Dialog box3) Menu 4) Push button 5) Edit Box 6) Checkbox 7) Radio button 8) List box 9) Combo box If the class property of the object is defined as Object or WinObject or WebElement depending on the type of application you are using, then it is not a standard object and comes under the category of Non-Standard object. >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  31. How to identify an object if it is not associated with any standard class? Parameterization Any object which is not associated with the standard class will have a class of either Win Object (for Windows applications) or Web Element (for web applications) and are considered as Non-Standard objects. Non-standard objects are represented with a special Tri-colored symbol in the Object Repository. >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  32. How to identify an object if it is not associated with any standard class? Parameterization >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  33. Object Repository What is an Object Repository? Object Repository (OR) is a collection of objects pertaining to the application under test. Example: All the text boxes. list boxes, images etc are stored in a file in QTP. This file is called the object repository. Each object will have the set of properties to identify that object uniquely in the application. At the time of execution, QTP identifies the objects on the screen by comparing them with the objects and their properties in the repository. >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  34. Types of Object Repositories in QTP QTP has two types of Object Repositories.1. Action Local repository2. Shared Object Repository We can have any number of Shared Object Repositories associated with an action. All the objects will be recorded into the local repository and we need to export the objects from local repository into the shared object repository by opening the object repository and selecting File Menu and selecting "Export Local Objects". You need to specify the name for the shared object repository in which you want to save these objects. >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  35. Types of Object Repositories in QTP How to Associate multiple Object repositories for a test? 1) Open the object repository of the action and click on the icon Associate Repositories on the tool bar. 2) Associate repositories window opens. 3) Click on the green "+" sign and browse the shared object repository and select it. All the actions which are available in that script will be shown in the Available Actions section of that window >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  36. Types of Object Repositories in QTP How to Associate multiple Object repositories for a test? 4) Select the action which we want to associate the repositories to and click on the ">" arrow to send it to the "Associated Actions" section of the windowThis will ensure that the actions in the associated actions will have access to all the objects in the associated object repositories. We can associate any number of object repositories. >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  37. Types of Object Repositories in QTP How to Associate multiple Object repositories for a test? >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  38. Differentiation between Following two modes: 1) Object Repository Per Action Mode &2) Shared Object Repository Mode. Different Object Repositories Modes Local Object Repository Mode In this mode there is no need to save the Object repository. It is automatically loaded with the script and saved into the script folder. The effort to maintain Object Repository is relatively less, but if we have a lot of tests we get confused with the Object Repositories and when a change is made in application it has to be modified in all the Object Repositories. >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  39. Object Properties What are Object Properties? Most Objects will have two types of properties defined within the application. 1) Identification Properties 2) Native Properties The properties defined for the object in the application can be discovered by using the object spy icon which is on the toolbar or from "Tools” menu select Object Spy. >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  40. Identification Properties What are Identification Properties? These are the properties which an object attains based on the condition within the application. Example: The FLIGHT button is designed to have a runtime/Identification property of enabled=False when we open the Flight reservation window and once we select the Date and fly from and fly to this objects runtime property is designed to change the enabled=True.These are dynamic values which can keep changing. >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  41. Native Properties What are Native Properties? These are the properties defined within the application for each object which will act as base properties and they may not change dynamically. >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  42. Functions in QTP What is a function? Function is a program which takes in the arguments or parameters and does the steps specified in the program and ultimately gives us an output. >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  43. Functions in QTP Function verify Button Status(ButtonName ,ExpectedStatus)AclualStatus= wlndow("Flight Reservation") WinButton(ButtonName) GetROProperty("enabled') If Actuastatus= ExpectedStatus Then Reporter.ReportEvent micpass,'Verify Flight Button' "Flight button was disabled as expected" else Reporter.ReportEvent micFail,"Verify Flight Button "Flight button was enabled but the expected was disabled" End If End FunctionFunction Call: VerifyButtonStatus "FLIGHT",False >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  44. Functions in QTP Return ValueA function should return a value in most of the cases. This return value can be used in the script where the function is being called for various reasons. A return value should be returning either a variable from the function or value calculated in the function or any value string which we specify within the function such as "Pass" or "Fail". To return a return value give the function name = Value to be returned. For example: If the return value given by Login function is "Pass" or "True" we may want to continue further testing else we may want to end the test if it returns a value of "Fail" or "False". >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  45. Functions in QTP Return Value continued var FIightLogin = FlightLogin(”piyush", "mercury") If var FIightLogin, = "Pass" Then RunAction "OrderEntry [OrderEntry]", alliterations RunAction "FlightLogout [FlightLogout]", onelteration else ExitActionlteration() End If >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  46. Functions in QTP Storage of Functions in separate function libraries QTP functions can be written and stored in a VB Script file which has an extension of vbs (plain text file stored with an extension of vbs) and we can attach that file in the "File”"Settings" “Resources” and under resources we have the top most section which says "Associated library files". Click on the "+" sign in that section and browse the VB Script file which has the functions you created. For example: 'Function to close all browsers before starting the test execution can be given as: call CIoseAllBrowsers() or simply CIoseAllBrowsers() >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  47. Functions in QTP Storage of Functions All the functions should be stored in a common function library. Open a blank notepad file. Paste all the functions in that and save that file with an extension vbs and with a name which can identify it as a function library (For example: FlightFunctionLibrary). Save this file under a new folder called "Function Libraries" in the project folder. >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  48. Functions in QTP What is VBS? VBS stands for Visual Basic Script. Once you save the library go to QTP and select Settings from the File menu. Test Settings window appears. Go to Resources Tab. We will see a section called Function Libraries. Click on the Green "+" sign in that and browse your function library which we saved in the project folder. Now all the functions present in that library will be available to all the scripts with this settings. We can save any number of functions in one vbs file but for maintenance purposes it is better to limit the number to 50 functions or build a separate function library for each module within the application if these modules are large modules. >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  49. Functions in QTP Where ever we need to call a function press F7 and the Step generator window will open. From the top drop down, select Functions and then from the second drop down, select library functions. Now we will be able to see a list of all the functions present in all the libraries which you attached to that script. Select the function which we need to use, give the arguments and press Insert button. The function call will be inserted in our script at the cursor position. >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

  50. Few Examples of Functions Function to Return the Maximum Number of Days in a MonthFunction NoOfDaysInMonth(InMonth) Dim NoOfDays Select Case InMonthCase "01", "1", "03", "3", "05", "5", "07", "7", "08", "8", "10", "12” NoOfDaysinMonth ="31" Case "02", "2” NoOfDaysInMonth = "28" Case "04", "4", "06", "6", "09", "9", "07", "11" NoOfDaysinMonth = "30" Case Else NoOfDayslnMonth = "The value passed is an illegal parameter" End Select End Function >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

More Related