QTP | Scripting Language | Microsoft Windows

Do you know QTP!

Prepared By : Sreelesh Kunnath

What is AutomationAutomation-

Test Automation is the use of software to control the execution of tests & 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.

Wednesday, September 15, 2010

Sreelesh Kunnath


Why AutomationAutomation-

. Avoid the errors that human make when they get
tired after multiple repetitions. . The test program wont skip any test by mistakes. . Each feature test cycle will take less time & Required less human intervention. . Required for Easy cycle of Regression Testing.

Wednesday, September 15, 2010

Sreelesh Kunnath


Benefits of Test AutomationAutomation-

. 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

Wednesday, September 15, 2010

Sreelesh Kunnath


False BenefitsBenefits-

. Fewer tests will be needed
. It will be easier if it is automated . Compensate for poor design . No more Manual Testing

Wednesday, September 15, 2010

Sreelesh Kunnath


What are the different tools available in the market (for functional testing)testing). September 15. Web FT Wednesday. Silk Test . QTP . Rational Robot . Win Runner . 2010 Sreelesh Kunnath 6 . QA Run .

2010 Sreelesh Kunnath 7 . September 15.Life Cycle Of AutomationAutomation- Analyze the Application Select The Tool Identify the session Design/ Record Test Scripts Run the test scripts Finding & Reporting the defects Wednesday.

Main Frames. between WR & QTPQTP- QTP Developed by MI Now HP Functionality testing on windows & web based applications It Supports . people soft 6.8 Developed by MI Win Runner 7.NET Technology Scripting language is VB-Script Active Screen Available in QTP QTP has data table to store script values QTP supports Multimedia.0. 2010 Sreelesh Kunnath 8 . J2EE It supports ERP such as SAP.NET Technology Scripting language is TSL Not Available Not available It won·t support But WR supports Siebel 6.0 Functionality testing on windows based application Does not support .0 Wednesday. Siebel 7. September 15.0.What is the diff. people Soft 8. XML.

Linux etc Wednesday. 2010 Sreelesh Kunnath 9 . Test Script developed on VB Script . QTP supports Languages is . People soft . QTP run on only windows platform not supporting UNIX. Main Frame. QTP Supports both Technical & Non Technical People .NET. Developed for web functionality . Developed by Mercury interactive But Now by HP .Introduction to QTP - . QTP Developed in 2002 . September 15.Java ERP -> SAP.QTP supports both web applications & windows applications . Seibel. XML. J2EE.

5 8.0 6.9.5 5.2 2002 Industry started from this version Rapidly working on(8.0.Versions of QTP QTP 5.0 9..6 6.0) 10 Current Version Wednesday. 2010 Sreelesh Kunnath 10 .0 9. September 15.

6.0. 6. 7.Environment needs for QTP - System Requirement Hardware Drive RAM OS : 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. 7. 9.0 Sreelesh Kunnath 11 Web Browser Wednesday.1 AOL 8. 2010 . September 15.5 Netscape Navigator 6.

Overview of QTP 1) 2) 3) 4) 5) 6) 7) 8) 9) 10) 11) 12) 13) 14) 15) 16) 17) 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 Wednesday. 2010 . September 15.

September 15.Overview of QTP - 1) 2) 3) 4) 5) 6) 7) 8) 9) Output Values Synchronization point QTP Run Modes Regular Expressions Descriptive Programming Environment Variables VB-Script Hoe to work with Functions Associated Library Wednesday. 2010 Sreelesh Kunnath 13 .

2010 Sreelesh Kunnath 14 . September 15.Testing Process of QTP 1) Record & 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 Wednesday.

September 15. 2010 Sreelesh Kunnath 15 .Window Structure of QTP 1) Test Pane 2) Active Screen 3) Data Table 4) Debug Viewer Wednesday.

2010 Sreelesh Kunnath 16 .NET 5) Terminal Emulator 6) SAP 7) Siebel Wednesday. September 15.Add Ins of QTP It gives information about the technology supported by the QTP By 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) .

Add In Manager Wednesday. 2010 Sreelesh Kunnath 17 . September 15.

Architecture Of QTP 1) 2) Execution Process in QTP Development of Automation Test 1) Recording 2) Writing 3) Function Generator Wednesday. 2010 Sreelesh Kunnath 18 . September 15.

Recording Modes of QTP - There are three recording modes in QTP 1)Normal Recording Mode 2) Analog Recording Mode 3) Low Level Recording Mode Wednesday. 2010 Sreelesh Kunnath 19 . September 15.

Record a Test Wednesday. 2010 Sreelesh Kunnath 20 . September 15.

2010 Sreelesh Kunnath 21 . September 15.Record & Run SettingsSettings- Wednesday.

2010 Sreelesh Kunnath 22 . September 15.Run a Test and Save ResultsResults- Wednesday.

View Test ResultsResults- Wednesday. September 15. 2010 Sreelesh Kunnath 23 .

2010 Sreelesh Kunnath 24 .Object RepositoryRepository- Object Repository is nothing but a storage location. It contains the collection logical name and physical description of a particular object.mtr) 2) Shared Object Repository (.tsr) Wednesday. Logical Name: For Naming Convention Physical Description : is Nothing but expected physical properties Two types of Object Repositories are available in QTP1) Per Action (. September 15.

Open the Object Repository Dialog BoxBox- Wednesday. September 15. 2010 Sreelesh Kunnath 25 .

Exists Then Msgbox(´Passµ) else Msgbox(´Failµ) End If Wednesday. Example: If window(´Loginµ). 2010 Sreelesh Kunnath 26 . September 15.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.

Click 80.Virtual Button(´REDµ) Window(´Paintµ).Winobject(´colorsµ).Virtual ObjectObject- Virtual Object is used to identify the properties of similar objects in a particular Area.Close Wednesday.Winobject(´colorsµ). the script will look like thiswindow(´Paintµ).16 Window(´Paintµ).Click 72.Winobject(´colorsµ).Virtual Button(´BLUEµ) window(´Paintµ). September 15. the script will look like thiswindow(´Paintµ). 2010 Sreelesh Kunnath 27 .Winobject(´colorsµ).Activate Window(´Paintµ).Activate Window(´Paintµ).Close If we are using Virtual object. Example: In normal recording if we select the paint brush window.14 window(´Paintµ).

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 Point Wednesday.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. September 15. 2010 Sreelesh Kunnath 28 .

2010 Sreelesh Kunnath 29 . September 15.Checkpoint Types Wednesday.

September 15. 2010 Sreelesh Kunnath 30 .Inserting a Checkpoint During RecordingRecording- Wednesday.

September 15. 2010 Sreelesh Kunnath 31 .Insert a Checkpoint After RecordingRecording- Wednesday.

2010 Sreelesh Kunnath 32 .Identifying a Failed CheckpointCheckpoint- Wednesday. September 15.

2010 Sreelesh Kunnath 33 .ActionsActionsAction is nothing but a logical portion to entire script file based on the requirement. 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 Wednesday. Each and every action should have meaningful result. September 15.

(µpasswordµ.WinEdit(´Login nameµ).WinEdit(´Password).Activate Dialog(´Loginµ).Activate Dialog(´Loginµ). 2010 Sreelesh Kunnath 34 .WinEdit(´nameµ). How to use parameterization: Ex: Before parameterization Dialog(´Loginµ). September 15.Data Driven TestTestTesting the same application with multiple sets of data. dtglobalsheet) DialogµLoginµ.Set DataTable(µnameµ.WinEdit(´Password).Close Wednesday.Set µAxisµ Dialog(´Loginµ).Close After Parameterization Dialog(´Loginµ).SetSecureµaxisittµ DialogµLoginµ. dtglobalsheet) Dialog(´Loginµ).

2010 Sreelesh Kunnath 35 .Using Data Sheet (Global. Local & Location)Location)- Wednesday. September 15.

2010 Sreelesh Kunnath 36 .Setting the Parameter ValueValue- Wednesday. September 15.

2010 Sreelesh Kunnath 37 .Test Results IterationsIterations- Wednesday. September 15.

Types of Exception Handling: 1) Popup Exception Handling 2) Object State Exception Handling 3) Test Run Exception Handling 4) Application Crash Wednesday. 2010 Sreelesh Kunnath 38 . September 15.Exception HandlingHandling- It enables Quick test to detect and handle when unexpected error occurred during execution time.

Object IdentificationIdentification- 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 Wednesday. September 15. 2010 Sreelesh Kunnath 39 .

2010 Sreelesh Kunnath 40 . Three Components are available in ordinal identifier 1) Index 2) Location 3) Creation time Wednesday.Ordinal IdentifierIdentifier- By using ordinal identifier options quick test able to identify an object under ordinal identifier. September 15.

2010 Sreelesh Kunnath 41 . September 15. Two properties are available in Smart identification They are1) Base Filter Properties 2) Optional Filter Properties Wednesday. To identify such object we need to use Smart Identification. it is change randomly.Smart IdentificationIdentification- Quick test unable to identify the object.

There are 4 types of synchronization points: 1) Sync 2) Wait. September 15.Synchronization PointPoint- Synchronization point maintains the time coordination between testing process and your application process. 2010 Sreelesh Kunnath 42 . wait(5) or wait 5 3) Wait Property 4) Exist Wednesday.

September 15. we have 2 types of run modes1) Normal 2) Fast Wednesday. 2010 Sreelesh Kunnath 43 .QTP Test Run ModesModesIn QTP.

2010 Sreelesh Kunnath 44 .Regular ExpressionsExpressions- 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«. September 15.etc Wednesday.

September 15. 2010 Sreelesh Kunnath 45 .Using a Regular ExpressionExpression- Wednesday.

* + [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 Wednesday. September 15. 2010 Sreelesh Kunnath 46 .Some Regular ExpressionsExpressionsExpression Period Asterisk Plus Brackets Char .

2010 Sreelesh Kunnath 47 .Close Wednesday.wineidt(´attached text:= Login nameµ).wineidt(´attached text:= Passwordµ). Dialog(´text:=Loginµ).Activate Dialog(´text. Set ´88888µ .Descriptive ProgrammingProgramming- Without using the object repository test engineer can develop automation test in this particular accept. September 15. we need to use a technique called as descriptive programming.=Loginµ). Set ´Axisittµ Dialog(´text:=Loginµ). Script: Dialog(´test:=Loginµ).

2010 Sreelesh Kunnath 48 . Environment Variables Built In user defined Internal External Wednesday. September 15.How to work with Environmental variablesvariables- it is a special type of variable which is use to expose the data related to environment.

Best Practice and tips 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 center Wednesday. September 15. 2010 Sreelesh Kunnath 49 .

Comments & QueriesQueriesQueries are always welcome. Wednesday. 2010 Sreelesh Kunnath 50 . September 15.

kunnath@ust-global. -if helpful please mail sreelesh.kunnath@gmail. September 15.FeedbackFeedback- -Please spend few minutes from your valuable time to provide your feedback. 2010 Sreelesh Kunnath 51 .com -if any query please mail sreelesh.com Thanks & Happy Automation future Wednesday.

Sign up to vote on this title
UsefulNot useful