Your SlideShare is downloading. ×
0
Functional Testing with Mercury Quick Test Professional Niranjan Dash, Rajini G. SHARP Automation
Agenda <ul><li>Basic Automation using QTP </li></ul><ul><ul><li>Functional Testing Overview </li></ul></ul><ul><ul><li>Fun...
Functional Testing Overview <ul><li>Definition </li></ul><ul><ul><li>“ Certify the application  from a business perspectiv...
Functional Testing Elements <ul><li>Test Environment  (People, Processes, Hardware) </li></ul><ul><ul><li>Dedicated people...
QTP Automation Benefits
Script Development with QTP
QTP Demonstration
Record and Run <ul><li>Recording levels </li></ul><ul><ul><ul><li>Standard recording </li></ul></ul></ul><ul><ul><ul><li>A...
Data types in QTP <ul><li>Some of the supported data types in QTP: </li></ul><ul><ul><li>String, Integer, Boolean, Decimal...
Scripting in QuickTestPro <ul><ul><li>Note:  VB Script is used in QuickTestPro for automating Testcases. </li></ul></ul><u...
Expected Result “Checkpoints”
Window(&quot;Flight Reservation&quot;).Activate Window(&quot;Flight Reservation&quot;).WinButton(&quot;FLIGHT&quot;).Check...
Synchronization <ul><li>Options to Synchronize tests </li></ul><ul><ul><ul><li>Call wait </li></ul></ul></ul><ul><ul><ul><...
Advanced QTP Features
Parameterizing Testing <ul><li>Different groups of parameters </li></ul><ul><ul><ul><li>Data table parameter </li></ul></u...
Working with Multiple Actions <ul><li>Action </li></ul><ul><li>Creating Actions </li></ul><ul><ul><ul><li>Divide the test ...
Recovery Manager and Scenarios <ul><li>Use of recovery scenario </li></ul><ul><li>Recovery scenario consists of the follow...
 
 
Importance of Object Repository <ul><li>Object repository </li></ul><ul><li>Object identification </li></ul><ul><li>Identi...
 
Test Objects & Runtime Objects Test Objects (TO) <ul><li>Used by QT to represent objects in AUT </li></ul><ul><li>TO prope...
Object Identification & Smart Identification <ul><li>QTP identifies run-time objects based on TO properties whose values a...
Object Identification & Smart Identification Match Object Description Create a list of objects (within the parent object) ...
Smart Identification <ul><li>Properties for Smart ID are recorded, but not used during replay </li></ul><ul><li>When Smart...
Smart Identification <ul><li>Configuring Smart Identification Tools    Object Identification  </li></ul><ul><li>Disable f...
Test Results
Questions?
Thank you!
Upcoming SlideShare
Loading in...5
×

Qtp Mgl Presentation

574

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
574
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
31
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Qtp Mgl Presentation"

  1. 1. Functional Testing with Mercury Quick Test Professional Niranjan Dash, Rajini G. SHARP Automation
  2. 2. Agenda <ul><li>Basic Automation using QTP </li></ul><ul><ul><li>Functional Testing Overview </li></ul></ul><ul><ul><li>Functional Testing Elements </li></ul></ul><ul><ul><li>Script Development with QTP </li></ul></ul><ul><ul><li>QTP Automation Benefits </li></ul></ul><ul><ul><li>Record and Run </li></ul></ul><ul><ul><li>Checkpoints and Synchronization </li></ul></ul><ul><li>Advanced QTP Features </li></ul><ul><ul><li>Parameterization </li></ul></ul><ul><ul><li>Multiple Actions </li></ul></ul><ul><ul><li>Recovery Scenario </li></ul></ul><ul><ul><li>Runtime Objects & Test Objects </li></ul></ul><ul><ul><li>Object Identification </li></ul></ul><ul><ul><li>Test Results </li></ul></ul>
  3. 3. Functional Testing Overview <ul><li>Definition </li></ul><ul><ul><li>“ Certify the application from a business perspective” </li></ul></ul><ul><li>Process </li></ul><ul><ul><li>Validate application functions against the functional </li></ul></ul><ul><ul><li>specification, i.e., functions yield the expected results? </li></ul></ul><ul><ul><li>Report and track defects </li></ul></ul><ul><ul><li>Measure test coverage and track application quality </li></ul></ul>
  4. 4. Functional Testing Elements <ul><li>Test Environment (People, Processes, Hardware) </li></ul><ul><ul><li>Dedicated people, infrastructure, test database(s) </li></ul></ul><ul><li>Test Case Inventory (Excel or TestDirector) </li></ul><ul><ul><li>Documented inventory of tests (Step, Action, Data, Expected Result) </li></ul></ul><ul><li>Test Script Development (QuickTestPro) </li></ul><ul><ul><li>Convert documented test case into reusable automated script </li></ul></ul><ul><li>Test Case Execution (Manual, QTP, or TestDirector) </li></ul><ul><ul><li>Execute test cases, document results </li></ul></ul><ul><li>Defect Reporting (Excel or TestDirector) </li></ul><ul><ul><li>If Actual Result = Expected Result, raise defect </li></ul></ul><ul><li>Test Coverage (Excel or TestDirector) </li></ul><ul><ul><li>What percentage of application functions tested? </li></ul></ul><ul><li>Quality Measurement (Excel or TestDirector) </li></ul><ul><ul><li>Trended rate of finding / fixing defects </li></ul></ul>
  5. 5. QTP Automation Benefits
  6. 6. Script Development with QTP
  7. 7. QTP Demonstration
  8. 8. Record and Run <ul><li>Recording levels </li></ul><ul><ul><ul><li>Standard recording </li></ul></ul></ul><ul><ul><ul><li>Analog recording </li></ul></ul></ul><ul><ul><ul><li>Low level recording </li></ul></ul></ul><ul><li>Run modes </li></ul><ul><ul><ul><li>Normal </li></ul></ul></ul><ul><ul><ul><li>Speed </li></ul></ul></ul><ul><ul><ul><li>Update run </li></ul></ul></ul>
  9. 9. Data types in QTP <ul><li>Some of the supported data types in QTP: </li></ul><ul><ul><li>String, Integer, Boolean, Decimal, Date, Variant </li></ul></ul><ul><li>Variable Declaration </li></ul><ul><ul><li>Dim sText </li></ul></ul><ul><ul><li>Dim iNumber </li></ul></ul><ul><ul><li>Dim aArray() ‘Dynamic Array </li></ul></ul><ul><ul><li>Dim aArray(10, 2, 5) </li></ul></ul><ul><li>Variable Assignment </li></ul><ul><ul><li>sText = “String Value” </li></ul></ul><ul><ul><li>iNumber = 10 </li></ul></ul><ul><ul><li>aArray = (“ABC”, “XYZ”) </li></ul></ul>
  10. 10. Scripting in QuickTestPro <ul><ul><li>Note: VB Script is used in QuickTestPro for automating Testcases. </li></ul></ul><ul><ul><li>Function Screen_Display(sButtonName1,sButtonName2) </li></ul></ul><ul><ul><li>Window(&quot;OsaSimulator&quot;).Page(&quot;Page&quot;).WebButton(&quot;name:=&quot;&sButtonName1).Click </li></ul></ul><ul><ul><li>Window(&quot;OsaSimulator&quot;).Page(&quot;Page&quot;).WebButton(&quot;Apply&quot;).Click </li></ul></ul><ul><ul><li>Window(&quot;OsaSimulator&quot;).Page(&quot;Page&quot;).WebButton(&quot;name:=&quot;&sButtonName2).Click </li></ul></ul><ul><ul><li>bScreen = Window(&quot;OsaSimulator&quot;).Page(&quot;Page&quot;).WebEdit(&quot;Screen&quot;).Exist </li></ul></ul><ul><ul><li>If bScreen Then </li></ul></ul><ul><ul><li>reporter.ReportEvent micPass, &quot;Custom Step&quot;, &quot;Pass: Verify the &quot; & sButtonName2 & &quot; screen displays&quot; </li></ul></ul><ul><ul><li>Report_Result 4, &quot;Verify the &quot; & sButtonName & &quot; screen displays&quot;, &quot;Pass&quot; </li></ul></ul><ul><ul><li>Else </li></ul></ul><ul><ul><li>reporter.ReportEvent micFail, &quot;Custom Step&quot;, &quot;Fail: Verify the &quot; & sButtonName2 & &quot; screen displays&quot; </li></ul></ul><ul><ul><li>Report_Result 4, &quot;Verify the &quot; & sButtonName & &quot; screen displays&quot;, &quot;Fail&quot; </li></ul></ul><ul><ul><li>End If </li></ul></ul><ul><ul><li>End Function </li></ul></ul>
  11. 11. Expected Result “Checkpoints”
  12. 12. Window(&quot;Flight Reservation&quot;).Activate Window(&quot;Flight Reservation&quot;).WinButton(&quot;FLIGHT&quot;).Check CheckPoint(&quot;FLIGHT&quot;) Window(&quot;Flight Reservation&quot;).WinObject(&quot;Date of Flight:&quot;).Type &quot;111111&quot; Window(&quot;Flight Reservation&quot;).WinComboBox(&quot;Fly From:&quot;).Select &quot;Frankfurt&quot; Window(&quot;Flight Reservation&quot;).WinComboBox(&quot;Fly To:&quot;).Select &quot;Los Angeles&quot; Window(&quot;Flight Reservation&quot;).WinButton(&quot;FLIGHT&quot;).Check CheckPoint(&quot;FLIGHT_2&quot;) Window(&quot;Flight Reservation&quot;).WinButton(&quot;FLIGHT&quot;).Click Window(&quot;Flight Reservation&quot;).Dialog(&quot;Flights Table&quot;).WinButton(&quot;OK&quot;).Click Window(&quot;Flight Reservation&quot;).WinEdit(&quot;Name:&quot;).Set &quot;aaaa&quot; Window(&quot;Flight Reservation&quot;).WinButton(&quot;Insert Order&quot;).Click Window(&quot;Flight Reservation&quot;).WinButton(&quot;Update Order&quot;).WaitProperty &quot;enabled&quot;, true, 10000 Window(&quot;Flight Reservation&quot;).WinButton(&quot;Button&quot;).Click
  13. 13. Synchronization <ul><li>Options to Synchronize tests </li></ul><ul><ul><ul><li>Call wait </li></ul></ul></ul><ul><ul><ul><li>Exist </li></ul></ul></ul><ul><ul><ul><li>wait property </li></ul></ul></ul><ul><ul><ul><li>Sync </li></ul></ul></ul>
  14. 14. Advanced QTP Features
  15. 15. Parameterizing Testing <ul><li>Different groups of parameters </li></ul><ul><ul><ul><li>Data table parameter </li></ul></ul></ul><ul><ul><ul><li>Other parameters </li></ul></ul></ul><ul><li>Data driver </li></ul>
  16. 16. Working with Multiple Actions <ul><li>Action </li></ul><ul><li>Creating Actions </li></ul><ul><ul><ul><li>Divide the test into multiple actions </li></ul></ul></ul><ul><ul><ul><ul><ul><li>Step > Split Action </li></ul></ul></ul></ul></ul><ul><ul><ul><li>Inserting call to new action </li></ul></ul></ul><ul><ul><ul><ul><ul><li>Insert > Call to New Action </li></ul></ul></ul></ul></ul><ul><ul><ul><li>Inserting existing </li></ul></ul></ul><ul><ul><ul><ul><ul><li>Insert > Call to Copy of Action </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Insert > Call to Existing Action </li></ul></ul></ul></ul></ul><ul><li>Setting action as Reusable </li></ul>
  17. 17. Recovery Manager and Scenarios <ul><li>Use of recovery scenario </li></ul><ul><li>Recovery scenario consists of the following </li></ul><ul><ul><ul><li>Trigger event </li></ul></ul></ul><ul><ul><ul><li>Recovery Operation </li></ul></ul></ul><ul><ul><ul><li>Post recovery test run option </li></ul></ul></ul><ul><li>To create a recovery file </li></ul><ul><ul><ul><li>Open the recovery scenario manager </li></ul></ul></ul><ul><ul><ul><ul><ul><li>Define a trigger event that interrupts the run session </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Specifying the recovery operations required to continue </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Choosing a post recovery test operation </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Specifying a name & description for the recovery scenario </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Specifying whether to associate this scenario to the current test or all new tests </li></ul></ul></ul></ul></ul>
  18. 20. Importance of Object Repository <ul><li>Object repository </li></ul><ul><li>Object identification </li></ul><ul><li>Identification techniques </li></ul><ul><ul><ul><li>Mandatory & Assistive property </li></ul></ul></ul><ul><ul><ul><li>Ordinary identifier </li></ul></ul></ul><ul><ul><ul><li>Smart identification </li></ul></ul></ul><ul><li>How can we add objects to repository </li></ul><ul><ul><ul><li>By recording </li></ul></ul></ul><ul><ul><ul><li>Through active screen </li></ul></ul></ul><ul><ul><ul><li>Add objects </li></ul></ul></ul><ul><li>Types of repositaries </li></ul><ul><ul><ul><li>Per action mode (.mtr) </li></ul></ul></ul><ul><ul><ul><li>Shared mode (.tsr) </li></ul></ul></ul>
  19. 22. Test Objects & Runtime Objects Test Objects (TO) <ul><li>Used by QT to represent objects in AUT </li></ul><ul><li>TO property set created and maintained by QT, captured from AUT during recording </li></ul><ul><li>Based on runtime object properties, but not necessarily 1-1 mapping </li></ul><ul><li>QT uses stored TO properties to identify AUT objects during test run </li></ul><ul><li>Access TO properties using GetTOProperty </li></ul><ul><li>Access TO methods directly </li></ul>Run-Time Objects (RO) <ul><li>Actual live objects in AUT </li></ul><ul><li>RO property set created and maintained by AUT, ‘queried’ from RO by QT </li></ul><ul><li>Access runtime property values (runtime value of property defined by QT) using .GetROProperty </li></ul><ul><li>Access native object properties using .Object </li></ul><ul><li>Access native object methods using .Object </li></ul>
  20. 23. Object Identification & Smart Identification <ul><li>QTP identifies run-time objects based on TO properties whose values are compared with the RO values </li></ul><ul><li>Recorded Mandatory + Assistive properties become mandatory object description used during replay </li></ul><ul><li>Smart Identification used when the object can’t be identified (during replay only) </li></ul><ul><li>Smart Identification is only invoked during replay , if enabled for the particular object class. </li></ul><ul><li>During the recording phase QTP records properties for Smart Identification, but doesn’t use them until Smart Identification is invoked </li></ul>
  21. 24. Object Identification & Smart Identification Match Object Description Create a list of objects (within the parent object) that match the description (mandatory + recorded assistive properties) that were recorded for this object. One Object? Return Object Multiple Objects? Are there more than two objects in the list? (If there was only one, we’d have returned it). Error Object not found Selector? Does this object have a location, index, or creation time selector? Use Selector Error Multiple objects If the selector for this object identifies an object in the original set, return the object. If not – error. Match base properties Create a list of objects under the parent object that match all the base properties for this object class. One Object? Optional Props? Filter by next optional property Smart Identification “ Forget everything we know, start over from scratch and look for the object based on what we think it should look like” Smart ID? Is Smart Identification turned on for this object class? Legend Yes No Smart ID successfully used to identify object (but used ordinal identifier) Warning: Identification would probably not have been possible without Smart ID – check your Object Repository!
  22. 25. Smart Identification <ul><li>Properties for Smart ID are recorded, but not used during replay </li></ul><ul><li>When Smart ID is invoked, QT uses the properties that were recorded to identify the object </li></ul><ul><li>Base and Optional Filter properties for Smart Identification must be set before-hand (so that QTP knows to record them). </li></ul><ul><li>Use only if required. Because QTP has to record more properties, enabling Smart Identification degrades performance </li></ul>
  23. 26. Smart Identification <ul><li>Configuring Smart Identification Tools  Object Identification </li></ul><ul><li>Disable for specific object </li></ul><ul><li>Disable for test run </li></ul><ul><li>Temporarily disable Smart Identification during replay Set App = CreateObject (&quot; QuickTest . Application &quot;) App . Launch App . Test . Settings . Run . DisableSmartIdentification = True … App . Test . Settings . Run . DisableSmartIdentification = False </li></ul><ul><li>Smart Identification in Test Results </li></ul><ul><li>Smart Identification Warning in Test Results </li></ul>
  24. 27. Test Results
  25. 28. Questions?
  26. 29. Thank you!
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×