Qtp92 Presentation


Published on

  • Be the first to comment

  • Be the first to like this

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

No notes for slide

Qtp92 Presentation

  1. 1. QTP 9.2 Material Prepared by Sriraman K
  2. 2. Objectives <ul><li>Automation – Need for automation, Rules of automation </li></ul><ul><li>Exposure to the Automation Concepts and Kick start the learning of one of the leading tool QTP </li></ul>
  3. 3. Need of Automation <ul><li>Speed – Automation Scripts run very fast when compared to human users </li></ul><ul><li>Reliable – Tests perform precisely the same operations each time they are run, there by eliminating human error. </li></ul><ul><li>Repeatable – We can test how the application reacts after repeated execution of the same operation </li></ul><ul><li>Comprehensive – We can build a suite of tests that covers every feature in our application </li></ul><ul><li>Reusable – We can reuse tests on different versions of an application, even if the user interface changes. </li></ul>
  4. 4. Rules of Automation <ul><li>Testing Tools are usually very expensive. </li></ul><ul><li>The test manager or the test lead has to </li></ul><ul><li>think twice before going in for automating </li></ul><ul><li>his test effort. There are also some widely </li></ul><ul><li>held false notions or beliefs about </li></ul><ul><li>automation tools. </li></ul><ul><li>In general, the golden rules that should be </li></ul><ul><li>kept in mind in the regard are. </li></ul>
  5. 5. Golden Rules <ul><li>Product feature understanding, test planning, test case documentation, test bed setup, defect tracking, progression tests are all done in manual mode </li></ul><ul><li>Test automation success depends on robustness of the test cases not on the test tool. </li></ul><ul><li>Every manual step has commands in test scripts </li></ul><ul><li>If it is not worth, DO NOT AUTOMATE. </li></ul><ul><li>Do not build application logic in your test scripts </li></ul><ul><li>Always have a common know base state for test cases </li></ul><ul><li>One test script Action must address one test case. </li></ul>
  6. 6. What are the different tools available in the market (for functional testing)- <ul><li>Quick Test Professional (HP) </li></ul><ul><li>WinRunner (HP) </li></ul><ul><li>Robot (IBM Rational) </li></ul><ul><li>Functional Tester (IBM Rational) </li></ul><ul><li>SilkTest (Borland) </li></ul><ul><li>TestComplete (AutomatedQA) </li></ul><ul><li>QAWizard (Seapine) </li></ul><ul><li>TestPartner (Compuware) </li></ul><ul><li>QEngine (AdventNet) </li></ul><ul><li>Open source tools (Sahi, Watir) </li></ul>
  7. 7. Life Cycle Of Automation- <ul><li>Analyze the Application </li></ul><ul><li>Select The Tool </li></ul><ul><li>Identify the session </li></ul><ul><li> Design/ Record Test Scripts </li></ul><ul><li>Run the test scripts </li></ul><ul><li>Finding & Reporting the defects </li></ul>
  8. 8. Introduction to QTP - <ul><li>Developed by Mercury interactive now owned by HP </li></ul><ul><li>Developed for web functionality </li></ul><ul><li>QTP supports both web applications & windows applications </li></ul><ul><li>QTP Developed in 2002, present version in the market is 9.5 </li></ul><ul><li>Test Script developed on VB Script </li></ul><ul><li>QTP supported Technology </li></ul><ul><ul><ul><li>.NET. J2EE, Main Frame, XML, Java, Delphi </li></ul></ul></ul><ul><ul><ul><li>ERP -> SAP, Seibel, People soft </li></ul></ul></ul><ul><li>QTP Supports both Technical & Non Technical People </li></ul><ul><li>QTP run on only windows platform not supporting UNIX, Linux etc </li></ul>
  9. 9. Environment needs for QTP 9.2 <ul><li>System Requirement : Equivalent to P3 and above </li></ul><ul><li>Hardware Drive : 250MB of Free Memory space </li></ul><ul><li>RAM : 512MB of RAM </li></ul><ul><li>OS : M/S windows 2000 server with 3-4 service pack </li></ul><ul><li> M/S windows XP with 1-2 SP </li></ul><ul><li> M/S windows 2003 with no service pack </li></ul><ul><li>Web Browser : MS Internet Explorer 5.5 and above </li></ul><ul><li>Netscape Navigator 6.11, 6.22, 6.23, 7.02, 7.1 </li></ul><ul><li> AOL 8.0, 9.0 </li></ul>
  10. 10. Add Ins of QTP - <ul><li>Technology supported by the QTP </li></ul><ul><li>By default three Add Ins are there in QTP </li></ul><ul><li>ActiveX </li></ul><ul><li>VB </li></ul><ul><li>Web </li></ul><ul><li>Additional Add ins: </li></ul><ul><li>Java </li></ul><ul><li>Oracle </li></ul><ul><li>People soft </li></ul><ul><li>.NET </li></ul><ul><li>Terminal Emulator (RTE) </li></ul><ul><li>SAP </li></ul><ul><li>Siebel </li></ul><ul><li>Delphi </li></ul>
  11. 11. Window Structure of QTP - <ul><li>1) Test Pane </li></ul><ul><li>2) Active Screen </li></ul><ul><li>3) Data Table </li></ul><ul><li>4) Debug Viewer </li></ul>
  12. 12. Architecture Of QTP - <ul><li>Script(.mts file) </li></ul><ul><li>Action1 Rep1(.mtr file) </li></ul><ul><li>Sheet1(localSheet) </li></ul><ul><li>Parameters (Action Parameter) </li></ul><ul><li>Shared Repository (.tsr File) Action2 Rep2 </li></ul><ul><li>Global Sheet Sheet2(localSheet) </li></ul><ul><li>Environment Parameter Parameters (Action Parameter) </li></ul><ul><li>Test Parameter </li></ul><ul><li>Action3 Rep3 </li></ul><ul><li>Sheet3(localSheet) </li></ul><ul><li>Parameters (Action Parameter) </li></ul><ul><li>“ </li></ul><ul><li>“ </li></ul>
  13. 13. Course Objective <ul><li>Object Spy </li></ul><ul><li>Object Identification </li></ul><ul><ul><li>Understanding customizing Non – Standard Objects </li></ul></ul><ul><ul><li>Understanding Way of Recognition </li></ul></ul><ul><li>Object Repository </li></ul><ul><li>Simple Record and Replay </li></ul><ul><li>Types of Record – Context Sensitive, Analog, Low Level Record </li></ul><ul><li>Managing Script with Various Data </li></ul><ul><ul><li>Parameters (DataTable) </li></ul></ul><ul><li>VB Scripting (String Manipulation, Msgbox, Split command, InStr, Loops, Conditions) </li></ul><ul><li>Managing Script with Dynamic Objects </li></ul><ul><ul><li>Regular Expression </li></ul></ul><ul><ul><li>Smart Identification </li></ul></ul><ul><li>Check Points – Standard, Bitmap, Text </li></ul>
  14. 14. Object Spy- <ul><li>Object spy is used to display or view all the physical properties and methods of an object. </li></ul>
  15. 15. Object Identification- <ul><li>Used to Map non Standard Object to Standard Object </li></ul><ul><li>Used to configure Recognition properties for an object class. </li></ul><ul><ul><li>Recognition properties are configured using </li></ul></ul><ul><ul><ul><li>Mandatory Properties </li></ul></ul></ul><ul><ul><ul><li>Assistive properties (are used when mandatory property fails to recognize the object uniquely) </li></ul></ul></ul><ul><ul><ul><li>Ordinal Identifier (are used when both mandatory and assistive fails to recognize the object uniquely) </li></ul></ul></ul><ul><ul><ul><ul><li>Location (Represent x- coordinate of the screen or parent object Nearest to x is 0) </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Index (Works based on active screen – active screen being 0 by default) </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Creation Time (For web browsers, no. of instances decides the creation time) </li></ul></ul></ul></ul>
  16. 16. Object Repository- <ul><li>Stores the object for the purpose of playing back </li></ul><ul><li>Uses Logical Name and Description properties to recognize the object from script and application respectively </li></ul><ul><li>Description Properties are created through Object Identification </li></ul><ul><li>Repository can be managed using Per Action mode (.mtr File) and Shared Repository Mode (.tsr File) by the script </li></ul>
  17. 17. Object Repository Dialog Box-
  18. 18. Recording Modes - <ul><li>Three Modes of Recording </li></ul><ul><ul><li>Context Sensitive or Normal Recording – Uses the object class and properties and method to perform action. </li></ul></ul><ul><ul><li>Analog Recording – Understands only the key or mouse movements </li></ul></ul><ul><ul><ul><ul><li>Relative to the screen: Desktop.RunAnalog “Track1” </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Relative to the window: Window(<<objName>>).RunAnalog “Track1” </li></ul></ul></ul></ul><ul><ul><li>Low Level Recording – Understand the x and y coordinate of the within the object on which the action is performed. </li></ul></ul><ul><ul><ul><li>Object(<<ObjName>>).Click (22,45) </li></ul></ul></ul>
  19. 19. Record a Test
  20. 20. Record & Run Settings-
  21. 21. Run a Test and Save Results-
  22. 22. View Test Results-
  23. 23. Virtual Object- <ul><li>Virtual Object is used to identify the properties of similar objects in a particular Area. </li></ul><ul><li>Example: In normal recording if we select the paint brush window, the script will look like this- </li></ul><ul><li>window(“Paint”).Activate </li></ul><ul><li>Window(“Paint”).Winobject(“colors”).Click 72,16 </li></ul><ul><li>Window(“Paint”).Winobject(“colors”).Click 80,14 </li></ul><ul><li>window(“Paint”).Close </li></ul><ul><li>If we are using Virtual object, the script will look like this- </li></ul><ul><li>window(“Paint”).Activate </li></ul><ul><li>Window(“Paint”).Winobject(“colors”).Virtual Button(“RED”) </li></ul><ul><li>Window(“Paint”).Winobject(“colors”).Virtual Button(“BLUE”) </li></ul><ul><li>window(“Paint”).Close </li></ul>
  24. 24. VB Scripting <ul><li>Msgbox() </li></ul><ul><li>Inputbox() </li></ul><ul><li>String manupulation </li></ul><ul><ul><ul><li>Using Variables </li></ul></ul></ul><ul><ul><ul><li>Using Concatenation </li></ul></ul></ul><ul><ul><ul><li>Split () </li></ul></ul></ul><ul><ul><ul><li>Instr() </li></ul></ul></ul><ul><li>Loops – For loop, Do while, Select Case </li></ul><ul><li>Conditions – If then Else </li></ul>
  25. 25. Parameters – Data manipulation <ul><li>Script Level Parameterization </li></ul><ul><ul><li>Constant </li></ul></ul><ul><ul><li>DataTable(“clmName”,dtLocal/GlobalSheet) </li></ul></ul><ul><ul><li>RandomNumber(start,End) </li></ul></ul><ul><ul><li>Environment(“Paraname”) </li></ul></ul><ul><ul><li>Action Parameter - Parameter(“ParaName”) </li></ul></ul><ul><li>Action Parameter </li></ul><ul><ul><li>Constant </li></ul></ul><ul><ul><li>DataTable </li></ul></ul><ul><ul><li>RandomNumber </li></ul></ul><ul><ul><li>Environment </li></ul></ul><ul><ul><li>Test Parameter </li></ul></ul><ul><li>Test Parameter </li></ul><ul><ul><li>Constant (Test Parameter can be configured only through Action Parameter) </li></ul></ul><ul><li>Environment Parameter </li></ul><ul><ul><li>Build In </li></ul></ul><ul><ul><li>User Defined </li></ul></ul>
  26. 26. Action Parameter <ul><li>Action Parameter </li></ul><ul><ul><li>To create an Action Parameter – Go to Action, Right Click, Select Action Properties and give Default value to be used. </li></ul></ul><ul><ul><li>To Modify Action Parameter default value – Go to Action, Right Click, Select Action Call Properties and select the parameter for which modification is needed, select value column and click on configure value button under value. </li></ul></ul><ul><ul><li>To control the iteration of Action Sheet, Go to Action, Right Click, Select Action call properties and Run tab </li></ul></ul>
  27. 27. Test Parameter &Environment <ul><li>Test Parameter </li></ul><ul><ul><li>File->Setting->Parameter Tab </li></ul></ul><ul><ul><li>Only constant value can be used </li></ul></ul><ul><ul><li>To use the test parameter in the script, Test parameter needs to configured to action parameter. </li></ul></ul><ul><li>Environment Parameter </li></ul><ul><ul><li>File->Setting->Environment Tab </li></ul></ul><ul><ul><li>Build in and User defined parameters </li></ul></ul><ul><ul><li>To use the environment in other machines, use export and import under environment parameter tab </li></ul></ul>
  28. 28. Setting the Parameter Value-
  29. 29. Using Data Sheet (Global, Local & Location)-
  30. 30. Multiple Actions <ul><li>How to Create New Actions? </li></ul><ul><ul><li>Creating as Independent Action (Call to New action, Select “at the end of test” radio button) </li></ul></ul><ul><ul><li>Creating as Nested Action (Call to new action, Select “After the current test” radio button) </li></ul></ul><ul><li>Dependent Action – One action depends on another action for want of data </li></ul><ul><ul><li>Using Datatable Output Value </li></ul></ul><ul><ul><li>Using Output Parameter Output Value </li></ul></ul><ul><ul><li>Output value </li></ul></ul><ul><ul><ul><li>Select the object from active screen, Right click, Select output value </li></ul></ul></ul><ul><ul><ul><li>At Recording time Select from menu Insert->Output Value->Standard Output value </li></ul></ul></ul>
  31. 31. Reusable Actions <ul><li>How to make an action as Reusable Action? </li></ul><ul><li>Passing Parameters for Reusable Action </li></ul><ul><ul><li>Using Input Parameters </li></ul></ul><ul><ul><li>Using Output Parameters </li></ul></ul><ul><li>SystemUtil Commands </li></ul><ul><li>.Exist Command </li></ul><ul><li>Syntex of Reusable Action </li></ul><ul><ul><li>RunAction “ActionName[ScriptName]”, One/Alliteration, Parameters(optional) </li></ul></ul>
  32. 32. Dynamic Objects- <ul><li>What is Dynamic Object? </li></ul><ul><li>When we can say, the object is dynamic? </li></ul><ul><li>Ways to Solve those dynamic objects </li></ul><ul><ul><li>SetTOProperty </li></ul></ul><ul><ul><ul><li>Parent().Object(“Logical”).SetTOProperty “propertyName”, Value </li></ul></ul></ul><ul><ul><li>Regular Expression </li></ul></ul><ul><ul><li>Repository Parameter </li></ul></ul><ul><ul><li>Smart Identification </li></ul></ul><ul><li>What is Smart Identification? </li></ul><ul><ul><li>It is a second level of Recognition Mechanism to recognize an object when it is failed using Description properties </li></ul></ul><ul><ul><li>It is not a permanent method to solve a dynamic object – It is an indication to the user that the object is not managed using description properties </li></ul></ul>
  33. 33. Regular Expressions- <ul><li>This can be used where there is a pattern of Change. </li></ul><ul><li>Regular Expressions can be used in the following areas: </li></ul><ul><li>1) Check Points </li></ul><ul><li>2) In parameterization </li></ul><ul><li>3) Data Driven test </li></ul><ul><li>4) Actions </li></ul><ul><li>5) Exception Handling….etc </li></ul>
  34. 34. Using a Regular Expression-
  35. 35. Some Regular Expressions- Matches exactly four digits d{4} Matches any digit d Digit Matches any non-alphanumeric character W Matches any alphanumeric character including underscore w Matches a range of numbers [0-9] Matches a range of characters [A-Z][a-z] Brackets Matches one to any number of occurrences of the preceding character + Plus Matches zero to any number of occurrences of the preceding character * Asterisk Matches any single character . Period Description Char Expression
  36. 36. Smart Identification- <ul><li>Smart Identification is used as Second level of recognition mechanism. When the Quick test fails to recognize the object through description properties, it tries to identify the object using Smart identification. </li></ul><ul><li>By invoking smart identification, system takes more time than usual time so if an object is identified in smart identification method then that object needs to be attended </li></ul><ul><li>Two properties are available in Smart identification </li></ul><ul><li>They are- </li></ul><ul><ul><ul><li>Base Filter Properties (This property has to match) </li></ul></ul></ul><ul><ul><ul><li>Optional Filter Properties (Atleast one of the property should be unique) </li></ul></ul></ul>
  37. 37. Synchronization Point- <ul><li>Synchronization point maintains the time coordination between testing process and your application process. </li></ul><ul><li>Types of Synchronization </li></ul><ul><ul><li>Sync </li></ul></ul><ul><ul><li>Wait </li></ul></ul><ul><ul><li>WaitProperty </li></ul></ul><ul><ul><li>Exist </li></ul></ul>
  38. 38. Check Points- <ul><li>Check Point is a verification point that compares the current value of the specified property with the expected value for that property. </li></ul><ul><ul><ul><li>Standard Check Point </li></ul></ul></ul><ul><ul><ul><li>Text/ Text Area Check Point </li></ul></ul></ul><ul><ul><ul><li>Bitmap Check point </li></ul></ul></ul><ul><ul><ul><li>Database Check Point </li></ul></ul></ul><ul><ul><ul><li>XML Check Point </li></ul></ul></ul><ul><ul><ul><li>Accessibility Check Point/ Web Checkpoint </li></ul></ul></ul>
  39. 39. Checkpoint Types
  40. 40. Inserting a Checkpoint During Recording-
  41. 41. Insert a Checkpoint After Recording-
  42. 42. Identifying a Failed Checkpoint-
  43. 43. Exception Handling- <ul><li>It enables Quick test to detect and handle when unexpected error occurred during execution time. </li></ul><ul><li>Types of Exception Handling: </li></ul><ul><ul><li>Popup Exception Handling </li></ul></ul><ul><ul><li>Object State Exception Handling </li></ul></ul><ul><ul><li>Test Run Exception Handling </li></ul></ul><ul><ul><li>Application Crash </li></ul></ul>
  44. 44. Comments & Queries- <ul><li>Queries are always welcome. </li></ul>
  45. 45. Your Voluntary Contribution <ul><li>To enhance the service by improving bandwidth and improve the e-learning methodology needs an investment, in case you feel this helps you, kindly contribute any amount to the below mentioned account. </li></ul><ul><li>“ Little drops of water make the mighty ocean”. </li></ul><ul><li>Expecting your kind support, it is absolutely voluntary and optional </li></ul><ul><li>Company : Softsmith Infotech Pvt Ltd. </li></ul><ul><li>Bank Name : HDFC Bank Ltd </li></ul><ul><li>Account Type : Current A/C </li></ul><ul><li>Account No : 05742320000031 </li></ul><ul><li>Branch : Chennai - Kodambakkam - Tamilnadu </li></ul><ul><li>Cust ID : 25417385 </li></ul><ul><li>Branch Code : 0574 </li></ul><ul><li>When remitting kindly mention your name and course </li></ul><ul><li>You can also send DD to the above mentioned name in case direct transfer is not possible. </li></ul><ul><li>Address is available at www.softsmith.com </li></ul>
  46. 46. Feedback- <ul><li>Please spend few minutes from your </li></ul><ul><li>valuable time to provide your feedback. </li></ul><ul><li>It will help us to improve in next sessions. </li></ul><ul><li>Contact Details </li></ul><ul><li>Sriraman K </li></ul><ul><li>Email : sriramank@softsmith.com </li></ul><ul><li>Thanks & Happy Testing.. </li></ul>