About Qtp_1 92


Published on

Published in: Technology
  • 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

About Qtp_1 92

  1. 1. <ul><ul><ul><li>Automation Fundamental Concepts and Intro. about QTP 9.2 </li></ul></ul></ul><ul><ul><ul><li>--Chandra Sekhar </li></ul></ul></ul>
  2. 2. Automation Fundamental Concepts <ul><li>What is Test Automation ? </li></ul><ul><ul><li>Software Test Automation is the process of automating the steps of manual test cases using an automation tool Or utility to shorten the testing life cycle with respect to time… </li></ul></ul><ul><ul><li>When application undergoes regression, some of the steps might be missed out or skipped which can be avoided in Automation… </li></ul></ul><ul><ul><li>Automation helps to avoid human errors and also expedite the testing process… </li></ul></ul><ul><ul><li>To implement the Test Automation detailed planning and effort is required </li></ul></ul>
  3. 3. Automation Fundamental Concepts <ul><ul><li>Automation saves time and effort which results in reduction of the Test life cycle… </li></ul></ul><ul><ul><li>Benefits of Automation </li></ul></ul><ul><ul><li>- Consistency of Test Execution </li></ul></ul><ul><ul><li>- Reducing cycle time of regression test cycles </li></ul></ul><ul><ul><li>- Data driven testing </li></ul></ul><ul><ul><li>- Repeatability </li></ul></ul><ul><ul><li>- Coverage </li></ul></ul><ul><ul><li>- Reliability </li></ul></ul><ul><ul><li>- Reusability of test wares </li></ul></ul>
  4. 4. Automation Fundamental Concepts <ul><li>Automation life cycle is a subset of the entire test life cycle… </li></ul><ul><li>Automation planning can be initiated in parallel to the test planning phase… </li></ul><ul><li>Factors to be considered in automation planning, </li></ul><ul><ul><li>Stability of AUT (Application under test) </li></ul></ul><ul><ul><li>No of regression cycles to be performed </li></ul></ul><ul><ul><li>Compatibility of App platform with testing tools </li></ul></ul><ul><ul><li>Cost benefit analysis (ROI) </li></ul></ul><ul><ul><li>Availability of skilled resources </li></ul></ul>
  5. 5. Regression Testing & Automation <ul><li>When Automation is applicable? </li></ul><ul><ul><li>Regression Testing Cycles are long and iterative. </li></ul></ul><ul><ul><li>If the application is planned to have multiple releases / builds </li></ul></ul><ul><ul><li>If it’s a long running application where in small enhancements / Bug Fixes keeps happening </li></ul></ul><ul><ul><li>Test Repeatability is required </li></ul></ul>
  6. 6. Technologies Supported <ul><li>Default Support 1. Standard Windows applications 2. Web objects / Applications 3. ActiveX controls 4. Visual Basic applications </li></ul><ul><li>Supported Add-ins QuickTest Professional Java Add-in 9.1 QuickTest Professional .NET Add-in 9.2 QuickTest Professional Oracle Add-in 8.2 QuickTest Professional PeopleSoft Add-in 8.2* QuickTest Professional Add-in 8.2 for SAP Solutions QuickTest Professional Siebel Add-in 8.0* QuickTest Professional Stingray Add-in 8.2 QuickTest Professional Terminal Emulator Add-in 8.0* QuickTest Professional VisualAge Smalltalk Add-in 8.2 QuickTest Professional Web Services Add-in 9.2 </li></ul>
  7. 7. Supported Browsers <ul><li>Microsoft Internet Explorer 6.0 Service Pack 1 </li></ul><ul><li>Microsoft Internet Explorer 7.0 </li></ul><ul><li>Netscape Browser 8.1.2 </li></ul><ul><li>Mozilla Firefox 1.5 </li></ul><ul><li>Mozilla Firefox 2.0 </li></ul>
  8. 8. Add-in Manager <ul><li>Default Add-ins </li></ul><ul><ul><li>ActiveX </li></ul></ul><ul><ul><li>Visual basic </li></ul></ul><ul><ul><li>Web </li></ul></ul><ul><li>Other Add-Ins </li></ul><ul><ul><li>Siebel </li></ul></ul><ul><ul><li>Java </li></ul></ul><ul><ul><li>SAP </li></ul></ul><ul><ul><li>Oracle </li></ul></ul><ul><ul><li>.Net and many more </li></ul></ul>
  9. 9. Add-in Manager Cont… <ul><li>QTP’s Add-in Manager facilitates the users to select the technology / environment from variety of environments suitable for the AUT (Application Under Test) </li></ul><ul><li>Once an add-in is loaded, users can record that application in its supported environment and thus QTP recognizes the objects specific to the application under test (AUT) as loaded through Add-in Manager. </li></ul><ul><li>It is critical for the users to know the development technologies / environment of AUT, and load right Add-Ins while invoking Quick Test Pro. </li></ul>
  10. 10. Quick Test Professional - Record & Run Modes <ul><li>Recording Modes </li></ul><ul><ul><li>Normal </li></ul></ul><ul><ul><li>Analog </li></ul></ul><ul><ul><li>Low level </li></ul></ul><ul><li>Run Modes </li></ul><ul><ul><li>Normal </li></ul></ul><ul><ul><li>Fast </li></ul></ul><ul><ul><li>Update </li></ul></ul>
  11. 11. Quick Test Professional -Tools  Options  General <ul><ul><li>Click on “Restore Layout” button to reset screens to the initial setting when QuickTest was first installed. </li></ul></ul>
  12. 12. Quick Test Professional - Tools  Options  Run
  13. 13. Quick Test Professional - Options  Run <ul><li>Best Practices for Options for Run Mode: </li></ul><ul><ul><li>Run Mode as Normal: </li></ul></ul><ul><ul><ul><li>This ensures that the execution arrow appears to help with trouble shooting the tests. </li></ul></ul></ul><ul><ul><ul><li>Synchronization becomes better for the AUT (Application Under Test) </li></ul></ul></ul><ul><ul><li>Test Results: </li></ul></ul><ul><ul><ul><li>Deselect the option “View Results when run session ends” </li></ul></ul></ul><ul><ul><li>Mercury Tool Integration: </li></ul></ul><ul><ul><ul><li>Select &quot;Allow other Mercury products to run tests and components“ </li></ul></ul></ul><ul><ul><li>Screen Capture: </li></ul></ul><ul><ul><ul><li>Save step screen capture to results &quot;On error and warnings&quot; </li></ul></ul></ul>
  14. 14. Automation  Record and Run Settings
  15. 15. Record and Run Settings <ul><li>Best Practices for Record & Run Settings </li></ul><ul><ul><li>Set the options to configure QTP to &quot;Record and run test on any open Windows- based application“ </li></ul></ul><ul><ul><li>Set the option - This window will appear the first time you click on the Record button in the new test. </li></ul></ul><ul><ul><li>Manually recall this window by selecting Automation  Record and Run settings </li></ul></ul>
  16. 16. QTP - Main Window
  17. 17. QTP - Main Window <ul><li>Test Pane: </li></ul><ul><ul><li>Test Pane contains two labs to view the tests, </li></ul></ul><ul><li>- Keyword View </li></ul><ul><li>- Expert View </li></ul><ul><ul><li>Keyword View: </li></ul></ul><ul><ul><ul><li>Quick Test Pro displays your test in the form of a collapsible, icon based tree… </li></ul></ul></ul><ul><ul><li>Expert View: </li></ul></ul><ul><ul><ul><li>Quick Test Pro displays the source code (VB Script) of the tests in this view. </li></ul></ul></ul>
  18. 18. Resources  Object Repository Can add a New Object to the repository More properties for recognizing the object can be added to the list. The value of property can be edited here.
  19. 19. Resources  Object Repository Manager
  20. 20. Resources  Associate Repositories Add shared Repository
  21. 21. Resources  Object Repository Associate repository is added to the Filter option.
  22. 22. Object Repository  Merging tool Secondary Repository Primary Repository .
  23. 23. Object Repository  Comparison Tool Comparing two repositories'
  24. 24. VB Script basics – Data Types
  25. 25. VB Script basics – Variables & Constants <ul><li>Declaring Variables </li></ul><ul><li>Naming Restrictions </li></ul><ul><li>Scope and Lifetime of Variables </li></ul><ul><li>Assigning Values to Variables </li></ul><ul><li>Scalar Variables and Array Variables </li></ul><ul><li>Creating Constants </li></ul>
  26. 26. VB Script basics - Operators
  27. 27. VB Script basics – Conditions & Looping <ul><li>Conditional Statements </li></ul><ul><ul><li>If...Then...Else statement </li></ul></ul><ul><ul><li>Select Case statement </li></ul></ul><ul><li>Looping </li></ul><ul><ul><li>Do...Loop: Loops while or until a condition is true. </li></ul></ul><ul><ul><li>While...Wend: Loops while a condition is true. </li></ul></ul><ul><ul><li>For...Next: Uses a counter to run statements a specified number of times. </li></ul></ul><ul><ul><li>For each...Next: Repeats a group of statements for each item in a collection or each element of an array. </li></ul></ul>
  28. 28. VB Script basics – Functions
  29. 29. Key areas in QTP <ul><li>About the script structure </li></ul><ul><li>Actions (Simple, Nested, External, Re-usable) </li></ul><ul><li>Parameterization (Different Types) </li></ul><ul><li>Checkpoints (Programmatic Methodology) </li></ul><ul><li>Descriptive programming </li></ul><ul><li>Adv. Synchronization points </li></ul><ul><li>Exception Handling </li></ul>
  30. 30. About the script structure
  31. 31. Actions (Simple, Nested, External, Re-usable) <ul><li>Standalone Actions </li></ul><ul><li>Nested Actions </li></ul><ul><li>Integration of Actions (Call from One Action to other) </li></ul><ul><li>Driver Action (Main Action) </li></ul><ul><li>Re-usable Actions </li></ul><ul><li>External Call for Actions </li></ul>
  32. 32. Parameterization <ul><li>Classifications of Parameterization </li></ul><ul><ul><li>Test and Action Parameters </li></ul></ul><ul><ul><li>Data Table (Global & Action Specific) </li></ul></ul><ul><ul><li>Environment variables </li></ul></ul><ul><ul><li>Random Number </li></ul></ul>
  33. 33. Types of Checkpoints Check that a Web page (or any portion of it) is displayed as expected. Checks an area of a Web page or application after capturing it as a bitmap Bitmap Checkpoint Check whether the expected text string is displayed in the expected location on a Web page or dialog box Checks that a text string is displayed in the appropriate place in a Web page or application window Text / Text Area Checkpoint Check how long a Web page takes to load or if a Web page contains broken links. Checks the characteristics of a Web page Page checkpoint Check that the value in a table cell is correct. Checks information in a table Table Checkpoint Check that the image source file is correct. Checks the property values of an image Image Checkpoint Check that a radio button is selected. Checks values of an object’s properties Standard Checkpoint
  34. 34. Types of Checkpoints Note: XML file checkpoints are used to check a specified XML file; XML application checkpoints are used to check an XML document within a Web page. Checks the data content of XML documents XML Checkpoint Check if the images on a Web page include ALT properties, required by the W3C Web Content Accessibility Guidelines. Identifies areas of a Web site to check for Section 508 compliancy Accessibility Checkpoint Check that the value in a database query is correct. Checks the contents of databases accessed by an application or Web site Database Checkpoint
  35. 35. Descriptive Programming Samples <ul><li>Descriptive programming </li></ul><ul><ul><li>Entering Programmatic Descriptions Directly into Statements </li></ul></ul><ul><ul><li>Browser(&quot;Mercury Tours&quot;).Page(&quot;Title:=Mercury Tours&quot;).WebEdit(&quot;Name:=Author&quot;, &quot;Index:=3&quot;).Set &quot;Mark Twain &quot; </li></ul></ul><ul><ul><li>Using Description Objects for Programmatic Descriptions </li></ul></ul><ul><ul><li>Set MyDescription = Description.Create() MyDescription(&quot;text&quot;).Value = &quot;OK&quot; MyDescription(&quot;width&quot;).Value = 50 Window(&quot;Error&quot;).WinButton(MyDescription).Click </li></ul></ul>
  36. 36. Adv. Synchronization Points <ul><ul><li>Using tool menu options </li></ul></ul><ul><ul><li>Wait property </li></ul></ul><ul><ul><li>Programmatically </li></ul></ul><ul><ul><li>Wait & exist </li></ul></ul>
  37. 37. Exception Handling <ul><li>Recovery Scenario Concepts </li></ul><ul><li>Recovery Process </li></ul><ul><ul><li>Trigger Events </li></ul></ul><ul><ul><li>Recovery Operation </li></ul></ul><ul><ul><li>Post-recovery Operation </li></ul></ul>
  38. 38. Sample Script – QTP Functions <ul><li>'sample 1 - Getting all the items from the combobox </li></ul><ul><li>My_Cnt = Window(&quot;Flight Reservation&quot;).WinComboBox(&quot;Fly From:&quot;).GetItemsCount </li></ul><ul><li>msgbox My_Cnt </li></ul><ul><li>For i = 1 to My_Cnt </li></ul><ul><li>' the combobox item index will start from zero. </li></ul><ul><li>My_item = Window(&quot;Flight Reservation&quot;).WinComboBox(&quot;Fly From:&quot;).GetItem(i-1) </li></ul><ul><li>Msgbox My_item </li></ul><ul><li>Next </li></ul><ul><li>'sample 2 - Getting the entire content of the combobox </li></ul><ul><li>Var_Content = Window(&quot;Flight Reservation&quot;).WinComboBox(&quot;Fly From:&quot;).GetContent </li></ul><ul><li>Msgbox Var_Content </li></ul>
  39. 39. Sample Script – QTP Functions <ul><li>'sample 3 - Selecting an item from the combo - Using Index </li></ul><ul><li>Window(&quot;Flight Reservation&quot;).WinComboBox(&quot;Fly From:&quot;).Select(5) </li></ul><ul><li>'sample 4 - Selecting an item from the combo - Using Value </li></ul><ul><li>Window(&quot;Flight Reservation&quot;).WinComboBox(&quot;Fly From:&quot;).Select(&quot;London&quot;) </li></ul><ul><li>'sample 5 - Selecting an item from the combo - Using Variable </li></ul><ul><li>Var_Item = &quot;Zurich&quot; </li></ul><ul><li>Window(&quot;Flight Reservation&quot;).WinComboBox(&quot;Fly From:&quot;).Select(Var_Item) </li></ul><ul><li>'sample 6 - Getting the value of selected item </li></ul><ul><li>Var_Sel = Window(&quot;Flight Reservation&quot;).WinComboBox(&quot;Fly From:&quot;).GetSelection </li></ul><ul><li>Msgbox Var_Sel </li></ul>
  40. 40. Sample Script – QTP Functions <ul><li>' Some FUM's (Frequently Used Methods) </li></ul><ul><li>'GetROProperty </li></ul><ul><li>Var_Text = Window(&quot;Flight Reservation&quot;).WinEdit(&quot;Name:&quot;).GetROProperty(&quot;AttachedText&quot;) </li></ul><ul><li>Msgbox Var_Text </li></ul><ul><li>Var_Enab = Window(&quot;Flight Reservation&quot;).WinEdit(&quot;Name:&quot;).GetROProperty(&quot;Enabled&quot;) </li></ul><ul><li>Msgbox Var_Enab </li></ul><ul><li>'Exist </li></ul><ul><li>If Window(&quot;Flight Reservation&quot;).WinEdit(&quot;Name:&quot;).Exist(5) Then </li></ul><ul><li>Msgbox &quot;The Editbox exists&quot; </li></ul><ul><li>Else </li></ul><ul><li>Msgbox &quot;The Editbox does not exist&quot; </li></ul><ul><li>End if </li></ul>
  41. 41. <ul><li>Thank You </li></ul>