Qtp Fundamentals

  • Published on

  • View

  • Download

Embed Size (px)


<p>Do you know QTP!</p> <p>Prepared By : Sreelesh Kunnath</p> <p>What is AutomationAutomation-</p> <p>Test Automation is the use of software to control the execution of tests &amp; the comparison of results- actual with the predicted/expected. A software program that is used to test another software program, this is referred to as Automated software testing. A third party tool is used to test the application. Use of automation tools reduces the test time as well as the cost.</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>2</p> <p>Why AutomationAutomation-</p> <p>. Avoid the errors that human make when they gettired after multiple repetitions. . The test program wont skip any test by mistakes. . Each feature test cycle will take less time &amp; Required less human intervention. . Required for Easy cycle of Regression Testing.</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>3</p> <p>Benefits of Test AutomationAutomation-</p> <p>. Allows more testing to be done. Strengthen Test Cycle . Testing is Consistent, repeatable . Useful when new patches released . Makes configuration testing easier . Test battery can be continuously improved</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>4</p> <p>False BenefitsBenefits-</p> <p>. Fewer tests will be needed. It will be easier if it is automated . Compensate for poor design . No more Manual Testing</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>5</p> <p>What are the different tools available in the market (for functional testing)testing). Rational Robot . Win Runner . QTP . Silk Test . QA Run . Web FT</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>6</p> <p>Life Cycle Of AutomationAutomation-</p> <p>Analyze the Application Select The Tool Identify the session Design/ Record Test Scripts Run the test scripts Finding &amp; Reporting the defectsFriday, December 03, 2010 Sreelesh Kunnath 7</p> <p>What is the diff. between WR &amp; QTPQTP-</p> <p>QTP Developed by MI Now HP Functionality testing on windows &amp; web based applications It Supports .NET Technology Scripting language is VB-Script Active Screen Available in QTP QTP has data table to store script values QTP supports Multimedia, Main Frames, XML, J2EE It supports ERP such as SAP, Siebel 7.0, people Soft 8.8 Developed by MI</p> <p>Win Runner 7.0</p> <p>Functionality testing on windows based application Does not support .NET Technology Scripting language is TSL Not Available Not available It wont support But WR supports Siebel 6.0, people soft 6.0</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>8</p> <p>Introduction to QTP -</p> <p>. Developed by Mercury interactive But Now by HP. Developed for web functionality .QTP supports both web applications &amp; windows applications . QTP Developed in 2002 . Test Script developed on VB Script . QTP supports Languages is.NET. J2EE, Main Frame, XML,JavaERP -&gt; SAP, Seibel, People soft</p> <p>. QTP Supports both Technical &amp; Non Technical People . QTP run on only windows platform not supporting UNIX, Linux etc</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>9</p> <p>Versions of QTP QTP 5.5 5.6 6.0 6.5 8.0 9.0 9.2 2002 Industry started from this version</p> <p>Rapidly working on(8.0,,9.0)</p> <p>10</p> <p>Current Version</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>10</p> <p>Environment needs for QTP -</p> <p>System Requirement Hardware Drive RAM OS</p> <p>: IBM-PC (or) Equivalent to P3 : 250MB of Free Memory space : 256MB of RAM : M/S windows 2000 server with 3-4 service pack M/S windows XP with 1-2 SP M/S windows 2003 with no service pack : MS Internet Explorer 5.5 Netscape Navigator 6.11, 6.22, 6.23, 7.02, 7.1 AOL 8.0, 9.0Sreelesh Kunnath 11</p> <p>Web Browser</p> <p>Friday, December 03, 2010</p> <p>Overview of QTP 1) 2) 3) 4) 5) 6) 7) 8) 9) 10) 11) 12) 13) 14) 15) 16) 17)</p> <p>Testing Process of QTP Windows Structure of QTP Add Ins of QTP Architecture of QTP Execution process in QTP Development of Automation Test Recording Modes in QTP Object Repository Object Spy Transaction Virtual Object Check Points Actions Exception Handling Object identification Ordinal Identifier Smart Identification Sreelesh Kunnath 12</p> <p>Friday, December 03, 2010</p> <p>Overview of QTP</p> <p>-</p> <p>1) 2) 3) 4) 5) 6) 7) 8) 9)</p> <p>Output Values Synchronization point QTP Run Modes Regular Expressions Descriptive Programming Environment Variables VB-Script Hoe to work with Functions Associated Library</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>13</p> <p>Testing Process of QTP 1) Record &amp; Run Settings 2) Develop Automation Testing 3) Enhance/ Customize Automation test 4) Debug Automation Test 5) Execute Automation Test 6) Analyze Test Results 7) Report defects in bug tracking tool</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>14</p> <p>Window Structure of QTP 1) Test Pane 2) Active Screen 3) Data Table 4) Debug Viewer</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>15</p> <p>Add Ins of QTP It gives information about the technology supported by the QTPBy default three Add Ins are there in QTP 1) ActiveX 2) VB 3) Web Additional Add ins: 1) Java 2) Oracle 3) People soft 4) .NET 5) Terminal Emulator 6) SAP 7) Siebel</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>16</p> <p>Add In Manager</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>17</p> <p>Architecture Of QTP 1) 2)</p> <p>Execution Process in QTP Development of Automation Test1) Recording 2) Writing 3) Function Generator</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>18</p> <p>Recording Modes of QTP -</p> <p>There are three recording modes in QTP 1)Normal Recording Mode 2) Analog Recording Mode 3) Low Level Recording Mode</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>19</p> <p>Record a Test</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>20</p> <p>Record &amp; Run SettingsSettings-</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>21</p> <p>Run a Test and Save ResultsResults-</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>22</p> <p>View Test ResultsResults-</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>23</p> <p>Object RepositoryRepository-</p> <p>Object Repository is nothing but a storage location. It contains the collection logical name and physical description of a particular object. Logical Name: For Naming Convention Physical Description : is Nothing but expected physical properties Two types of Object Repositories are available in QTP1) Per Action (.mtr) 2) Shared Object Repository (.tsr)</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>24</p> <p>Open the Object Repository Dialog BoxBox-</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>25</p> <p>Object SpySpyObject spy is used to display or view all the physical properties and methods of an object or a window based on the requirement. Example: If window(Login). Exists Then Msgbox(Pass) else Msgbox(Fail) End If</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>26</p> <p>Virtual ObjectObject-</p> <p>Virtual Object is used to identify the properties of similar objects in a particular Area. Example: In normal recording if we select the paint brush window, the script will look like thiswindow(Paint).Activate Window(Paint).Winobject(colors).Click 72,16 Window(Paint).Winobject(colors).Click 80,14 window(Paint).Close</p> <p>If we are using Virtual object, the script will look like thiswindow(Paint).Activate Window(Paint).Winobject(colors).Virtual Button(RED) Window(Paint).Winobject(colors).Virtual Button(BLUE) window(Paint).Close Friday, December 03, 2010 Sreelesh Kunnath 27</p> <p>Check PointsPointsCheck Point is a verification point that compares the current value of the specified property with the expected value for that property. There are 9 types of check points are available in QTP. They are1) Standard Check Point 2) Text/ Text Area Check Point 3) Bitmap Check point 4) Database Check Point 5) Table Check Point 6) Page Check Point 7) XML Check Point 8) Image Check Point 9) Accessibility Check PointFriday, December 03, 2010 Sreelesh Kunnath 28</p> <p>Checkpoint Types</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>29</p> <p>Inserting a Checkpoint During RecordingRecording-</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>30</p> <p>Insert a Checkpoint After RecordingRecording-</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>31</p> <p>Identifying a Failed CheckpointCheckpoint-</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>32</p> <p>ActionsActionsAction is nothing but a logical portion to entire script file based on the requirement. Each and every action should have meaningful result. Types of Actions: 1) Regular (By default) 2) Reusable 3) External How to work with Actions: 1) Call to copy of Action 2) Call to Existing Action</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>33</p> <p>Data Driven TestTestTesting the same application with multiple sets of data. How to use parameterization: Ex: Before parameterizationDialog(Login).Activate Dialog(Login).WinEdit(name).Set Axis Dialog(Login).WinEdit(Password).SetSecureaxisitt DialogLogin.Close</p> <p>After ParameterizationDialog(Login).Activate Dialog(Login).WinEdit(Login name).Set DataTable(name, dtglobalsheet) Dialog(Login).WinEdit(Password). (password, dtglobalsheet) DialogLogin.Close</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>34</p> <p>Using Data Sheet (Global, Local &amp; Location)Location)-</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>35</p> <p>Setting the Parameter ValueValue-</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>36</p> <p>Test Results IterationsIterations-</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>37</p> <p>Exception HandlingHandling-</p> <p>It enables Quick test to detect and handle when unexpected error occurred during execution time. Types of Exception Handling: 1) Popup Exception Handling 2) Object State Exception Handling 3) Test Run Exception Handling 4) Application Crash</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>38</p> <p>Object IdentificationIdentification-</p> <p>By using object identification we can map customer user defined object to standard Class. Two types of properties are their in object Identification: 1) Mandatory Properties 2) Assistive properties</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>39</p> <p>Ordinal IdentifierIdentifier-</p> <p>By using ordinal identifier options quick test able to identify an object under ordinal identifier. Three Components are available in ordinal identifier 1) Index 2) Location 3) Creation time</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>40</p> <p>Smart IdentificationIdentification-</p> <p>Quick test unable to identify the object, it is change randomly. To identify such object we need to use Smart Identification. Two properties are available in Smart identification They are1) Base Filter Properties 2) Optional Filter Properties</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>41</p> <p>Synchronization PointPoint-</p> <p>Synchronization point maintains the time coordination between testing process and your application process. There are 4 types of synchronization points: 1) Sync 2) Wait, wait(5) or wait 5 3) Wait Property 4) Exist</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>42</p> <p>QTP Test Run ModesModesIn QTP, we have 2 types of run modes1) Normal 2) Fast</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>43</p> <p>Regular ExpressionsExpressions-</p> <p>It enables quick test to identify test string with varying value (varying means changing) Regular Expressions can be used in the following areas:1) Check Points 2) In parameterization 3) Data Driven test 4) Actions 5) Exception Handling.etcFriday, December 03, 2010 Sreelesh Kunnath 44</p> <p>Using a Regular ExpressionExpression-</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>45</p> <p>Some Regular ExpressionsExpressionsExpression Period Asterisk Plus Brackets Char . * + [A-Z][a-z] [0-9] \w \W Digit \d \d{4} Description Matches any single character Matches zero to any number of occurrences of the preceding character Matches one to any number of occurrences of the preceding character Matches a range of characters Matches a range of numbers Matches any alphanumeric character including underscore Matches any non-alphanumeric character Matches any digit Matches exactly four digits</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>46</p> <p>Descriptive ProgrammingProgramming-</p> <p>Without using the object repository test engineer can develop automation test in this particular accept, we need to use a technique called as descriptive programming. Script:Dialog(test:=Login).Activate Dialog(text;=Login).wineidt(attached text:= Login name). Set Axisitt Dialog(text:=Login).wineidt(attached text:= Password). Set 88888 . Dialog(text:=Login).Close</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>47</p> <p>How to work with Environmental variablesvariables-</p> <p>it is a special type of variable which is use to expose the data related to environment.</p> <p>Environment Variables</p> <p>Built In</p> <p>user defined</p> <p>Internal</p> <p>External</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>48</p> <p>Best Practice and tips</p> <p>VB Script Associated library How to work with methods How to work with functions Back End testing How to work with Win Runner How to connect Quality centerFriday, December 03, 2010 Sreelesh Kunnath 49</p> <p>Comments &amp; QueriesQueriesQueries are always welcome.</p> <p>Friday, December 03, 2010</p> <p>Sreelesh Kunnath</p> <p>50</p> <p>FeedbackFeedback-</p> <p>-Please spend few minutes from yourvaluable time to provide your feedback. -if helpful please mail sreelesh.kunnath@ust-global.com -if any query please mail sreelesh.kunnath@gmail.com</p> <p>Thanks &amp; Happy Automation futureFriday, December 03, 2010 Sreelesh Kunnath 51</p>