Successfully reported this slideshow.

Gl qtp day 1 & 2

437 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Gl qtp day 1 & 2

  1. 1. Quick Test Professional By1 Rajat Gupta © Copyright GlobalLogic 2008
  2. 2. Agenda • Introduction to Automation Testing • QTP Testing Process • Add-in Manager • QTP Script Views • Object Repository • Checkpoints • Creating Output values • Actions • Results • Debugging Tests • User Defined Functions • Regular Expressions • Other Items2 © Copyright GlobalLogic 2008
  3. 3. Introduction to Automation Testing • What is Automation Testing ? • Benefits3 © Copyright GlobalLogic 2008
  4. 4. QTP Testing Process Quick Test testing process consists of 7 main phases 3. Preparing to record – Test Environment – Test Conditions 4. Recording a session on your application – Navigate according to Test Conditions 5. Enhancing your test – Adding logic and conditional statements – Parameterization – Inserting checkpoints 6. Debugging your test – Check that it operates smoothly and without interruption.4 © Copyright GlobalLogic 2008
  5. 5. QTP Testing Process 1. Run Test – Check the behavior of your application 2. Analyzing the test results  Reporting defects5 © Copyright GlobalLogic 2008
  6. 6. Add-in Manager • Default Add-ins – ActiveX – Visual basic – Web • Other Add-Ins – Siebel – Java – SAP – Oracle – .Net and many more QTP’s Add-in Manager facilitates the users to select the technology / environment from variety of environments suitable for the AUT (Application Under Test)6 © Copyright GlobalLogic 2008
  7. 7. QTP Window7 © Copyright GlobalLogic 2008
  8. 8. QTP – Keyword View8 © Copyright GlobalLogic 2008
  9. 9. QTP – Expert View9 © Copyright GlobalLogic 2008
  10. 10. Object Repository • Object repository dialog box displays a test tree of all objects in the current action or the entire application. • Using Object repository we can a) Identify the Object b) View the Object Properties10 © Copyright GlobalLogic 2008
  11. 11. Object Spy • Using the Object Spy, we can view the properties of any Object in the open application. • We can also view Object Methods.11 © Copyright GlobalLogic 2008
  12. 12. How Quick Test Recognizes Objects • For each object class, QTP has a default set of properties that it always learns. 1.Mandatory Properties. 2.Assistive properties. 3.Ordinal Identifier. • Usually, only a few properties are needed to uniquely identify an object.12 © Copyright GlobalLogic 2008
  13. 13. Recording Modes • Normal recording – Records the objects in your application and the operations performed on them. This mode is the default and takes full advantage of Quick Test’s test object model. • Analog Recording – Record the exact mouse and keyboard operations you perform in relation to either the screen or the application window. • Low-Level Recording – Record on any object in your application, whether or not Quick Test recognizes the specific object or the specific operation.13 © Copyright GlobalLogic 2008
  14. 14. Enhancing Tests • Parameterize Test • Regular Expressions • Creating Checkpoints • Creating Output Values • Dividing Tests into Multiple Actions14 © Copyright GlobalLogic 2008
  15. 15. Parameterize Tests To run the scenario with multiple sets of data. Steps for Parameterization • Defining a Data Table Parameter • Adding Parameter Values to a Data Table • Modifying Steps Affected by Parameterization • Running and Analyzing a Parameterized Test Demo…15 © Copyright GlobalLogic 2008
  16. 16. Regular Expressions • Regular expressions enable Quick Test to identify Objects and text strings with varying values. • User has to identify the data projected to be change, like dates, so to accepts any dates, user can use regular expression. Example : Actual Date format : 17/08/2008 (dd/mm/yyyy) After Regular Expression: [0-3][0-9]/[0-1][0-9]/200[0-9]16 © Copyright GlobalLogic 2008
  17. 17. Synchronization • Synchronization point enables the anticipated time problems between the application and QTP. • A progress bar reaches 100% completion. • A status message appears. • A button becomes enabled. • A window opens and is ready for data entry. • A pop-up message appears in response to an operation.17 © Copyright GlobalLogic 2008
  18. 18. How to Synchronize the Test We can synchronize the test by 1.Inserting a synchronization point Insert  Step  Synchronization point Window(“Flights”).WinButton(“Update order”).WaitProperty”enabled”,1,1000 2.Adding Exist and Wait statements status=Window(“Flights”).Dialog(“Flights Table”).Exist Wait(10)18 © Copyright GlobalLogic 2008
  19. 19. Checkpoints • A checkpoint is a verification point that compares a current value for a specified property with the expected value for that property. • We can Insert checkpoint 1.From Menu Insert  Checkpoint  Standard Checkpoint 2.From Keyword view 3.From the Active Screen19 © Copyright GlobalLogic 2008
  20. 20. Checkpoint Types Standard Checkpoint Checks values of an object’s properties Check that a radio button is selected. Image Checkpoint Checks the property values of Check that the image source file is correct. an image Table Checkpoint Checks information in a table Check that the value in a table cell is correct. Page checkpoint Checks the characteristics of a Web page Check how long a Web page takes to load or if a Web page contains broken links. Text / Checks that a text string is displayed in the appropriate Check whether the expected text string is Text Area Checkpoint place in a Web page or application window displayed in the expected location on a Web page or dialog box Bitmap Checkpoint Checks an area of a Web page Check that a Web page (or any portion of it) or application after capturing is displayed as expected. it as a bitmap20 © Copyright GlobalLogic 2008
  21. 21. Checkpoint Types Cont… Database Checkpoint Checks the contents of databases accessed by an Check that the value in a database query application or Web site is correct. Accessibility Checkpoint Identifies areas of a Web site Check if the images on a Web page to check for Section 508 compliancy include ALT properties, required by the W3C Web Content Accessibility Guidelines. XML Checkpoint Checks the data content of Note: XML file checkpoints are used to XML documents check a specified XML file; XML application checkpoints are used to check an XML document within a Web page.21 © Copyright GlobalLogic 2008
  22. 22. Text /TextArea Checkpoint Checks the Current Text format with the Expected Text Format in a Web page or application window Demo…22 © Copyright GlobalLogic 2008
  23. 23. Standard Checkpoint Checks values of an object’s properties Demo…23 © Copyright GlobalLogic 2008
  24. 24. Page Checkpoint • Checks the characteristics of a page • Check how long a Web page takes to load or if a Web page contains broken links. Demo…24 © Copyright GlobalLogic 2008
  25. 25. Bitmap Checkpoint • Checks an area of a Web page or application after capturing it as a bitmap • Check that a Web page (or any portion of it) is displayed as expected. Demo…25 © Copyright GlobalLogic 2008
  26. 26. Accessibility Checkpoint • Check if the images on a Web page include ALT properties, • required by the W3C Web Content Accessibility Guidelines Demo…26 © Copyright GlobalLogic 2008
  27. 27. Output Values • An output value is a step in which one or more values are captured at a specific point in your test and stored for the duration of the run session. The values can later be used as input at a different point in the run session. • You can output the property values of any object. You can also output values from text strings, table cells, databases, and XML documents. Demo for Text Output Value and Standard Output Value27 © Copyright GlobalLogic 2008
  28. 28. Actions • Actions help to divide Test Script into logical units • Usage : 1)We can design more modular and efficient tests. 2)Actions enable you to parameterize specific components of a test 3)Two or more tests can call the same action 4)Complex tests may have many actions and may share actions with other tests.28 © Copyright GlobalLogic 2008
  29. 29. Types of Actions We can divide Test Script into multiple actions by creating new actions or by inserting existing actions. Kinds of actions: • Non-Reusable Action : An action that can be used only in the test in which it was created, and only once. • Reusable Action : An action that can be called multiple times by the test in which it was created (the local test) as well as by other tests. • External Action : A reusable action created in another test. External actions are read-only in the calling test. They can be modified only in the test in which they were created.29 © Copyright GlobalLogic 2008
  30. 30. Insert Call to a New Action • You can add a new action during or after recording. • Select Insert -> Call to New Action from the QuickTest main menu. The Insert New Action window appears. • Or use the “Call to New Action” icon on the toolbar to insert new action.30 © Copyright GlobalLogic 2008
  31. 31. Splitting Actions We can split an existing action into two sibling actions or into parent-child nested actions. We cannot split an action and the option is disabled • when an external action is selected • when the first line of the action is selected • while recording a test • while running a test • when you are working with a read-only test31 © Copyright GlobalLogic 2008
  32. 32. Splitting Actions Cont…32 © Copyright GlobalLogic 2008
  33. 33. Inserting Existing Actions • We can insert an existing action by – Inserting a copy of the action It copied in its entirety, including checkpoints, parameterization, and the corresponding action tab in the Data Table. – Inserting a call to the original action We can insert a call (link) to a reusable action that resides in your current test (local action), or in any other test (external action).33 © Copyright GlobalLogic 2008

×