Prepared ByAshish Kumar Srivastava

What is Automation-

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.

 

Tuesday, August 12, 2008

Ashish Kumar Srivastava


Why Automation-

. 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.

Tuesday, August 12, 2008

Ashish Kumar Srivastava


Benefits of Test Automation-

. 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

Tuesday, August 12, 2008

Ashish Kumar Srivastava


False Benefits-

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

Tuesday, August 12, 2008

Ashish Kumar Srivastava


QA Run . Win Runner .What are the different tools available in the market (for functional testing). Silk Test . QTP . 2008 Ashish Kumar Srivastava 6 . August 12. Rational Robot . Web FT Tuesday.

2008 Ashish Kumar Srivastava 7 .Life Cycle Of AutomationAnalyze the Application Select The Tool Identify the session Design/ Record Test Scripts Run the test scripts Finding & Reporting the defects Tuesday. August 12.

August 12.0 Tuesday.0. people Soft 8.0. people soft 6. 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. 2008 Ashish Kumar Srivastava 8 . XML.What is the diff. Siebel 7. Main Frames. between WR & QTP- QTP Developed by MI Now HP Functionality testing on windows & 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.8 Developed by MI Win Runner 7.0 Functionality testing on windows based application Does not support .

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

0.5 5.6 6. August 12.Versions of QTP - QTP 5.5 8.0 6. 2008 Ashish Kumar Srivastava 10 .0 9..2 2002 Industry started from this version Rapidly working on(8.0) Current Version Tuesday.9.0 9.

22. August 12. 7.02.1 AOL 8. 9.11.Environment needs for QTP System Requirement Hardware Drive RAM OS pack : IBM-PC (or) Equivalent to P3 : 250MB of Free Memory space : 256MB of RAM : M/S windows 2000 server with 3-4 service M/S windows XP with 1-2 SP M/S windows 2003 with no service pack Web Browser : MS Internet Explorer 5.0 Ashish Kumar Srivastava 11 Tuesday. 2008 .5 Netscape Navigator 6.23. 6.0. 6. 7.

2008  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 Output Values Synchronization point QTP Run Modes Regular Expressions Descriptive Programming Environment Variables VB-Script Hoe to work with Functions Ashish Associated Library Kumar Srivastava 12 . August 12.Overview of QTP                          Tuesday.

August 12. 2008 Ashish Kumar Srivastava 13 .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 Tuesday.

Window Structure of QTP 1) Test Pane 2) Active Screen 3) Data Table 4) Debug Viewer Tuesday. August 12. 2008 Ashish Kumar Srivastava 14 .

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) .NET 5) Terminal Emulator 6) SAP 7) Siebel Tuesday. 2008 Ashish Kumar Srivastava 15 . August 12.

2008 Ashish Kumar Srivastava 16 .Add In Manager Tuesday. August 12.

August 12. 2008 Ashish Kumar Srivastava 17 .Architecture Of QTP - 1) 2) Execution Process in QTP Development of Automation Test 1) Recording 2) Writing 3) Function Generator Tuesday.

August 12. 2008 Ashish Kumar Srivastava 18 .Recording Modes of QTP - There are three recording modes in QTP 1)Normal Recording Mode 2) Analog Recording Mode 3) Low Level Recording Mode Tuesday.

August 12. 2008 Ashish Kumar Srivastava 19 .Record a Test Tuesday.

Record & Run Settings- Tuesday. 2008 Ashish Kumar Srivastava 20 . August 12.

August 12.Run a Test and Save Results- Tuesday. 2008 Ashish Kumar Srivastava 21 .

View Test Results- Tuesday. August 12. 2008 Ashish Kumar Srivastava 22 .

mtr) 2) Shared Object Repository (. August 12.tsr) Tuesday.Object RepositoryObject Repository is nothing but a storage location. Logical Name: For Naming Convention Physical Description : is Nothing but expected physical properties Two types of Object Repositories are available in QTP1) Per Action (. It contains the collection logical name and physical description of a particular object. 2008 Ashish Kumar Srivastava 23 .

August 12.Open the Object Repository Dialog Box- Tuesday. 2008 Ashish Kumar Srivastava 24 .

Object SpyObject spy is used to display or view all the physical properties and methods of an object or a window based on the requirement. Exists Then Msgbox(“Pass”) else Msgbox(“Fail”) End If Tuesday. 2008 Ashish Kumar Srivastava 25 . August 12. Example: If window(“Login”).

Click 80.Activate Window(“Paint”).Virtual Button(“RED”) Window(“Paint”).Winobject(“colors”). August 12.14 window(“Paint”).Virtual Button(“BLUE”) window(“Paint”).Close Tuesday. the script will look like thiswindow(“Paint”).Activate Window(“Paint”). the script will look like thiswindow(“Paint”). 2008 Ashish Kumar Srivastava 26 . Example: In normal recording if we select the paint brush window.Winobject(“colors”).Winobject(“colors”).Close If we are using Virtual object.Click 72.Virtual ObjectVirtual Object is used to identify the properties of similar objects in a particular Area.Winobject(“colors”).16 Window(“Paint”).

August 12. 2008 Ashish Kumar Srivastava 27 . 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 Tuesday. There are 9 types of check points are available in QTP.Check PointsCheck Point is a verification point that compares the current value of the specified property with the expected value for that property.

Checkpoint Types Tuesday. August 12. 2008 Ashish Kumar Srivastava 28 .

August 12.Inserting a Checkpoint During Recording- Tuesday. 2008 Ashish Kumar Srivastava 29 .

2008 Ashish Kumar Srivastava 30 .Insert a Checkpoint After Recording- Tuesday. August 12.

2008 Ashish Kumar Srivastava 31 .Identifying a Failed Checkpoint- Tuesday. August 12.

August 12.ActionsAction 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 Tuesday. 2008 Ashish Kumar Srivastava 32 .

WinEdit(“Login name”).SetSecure”axisitt” Dialog”Login”.Close After Parameterization Dialog(“Login”).Activate Dialog(“Login”).WinEdit(“name”). dtglobalsheet) Dialog(“Login”).WinEdit(“Password).Set ”Axis” Dialog(“Login”). How to use parameterization: Ex: Before parameterization Dialog(“Login”).Close Tuesday.Set DataTable(”name”. 2008 Ashish Kumar Srivastava 33 .Activate Dialog(“Login”). August 12.Data Driven TestTesting the same application with multiple sets of data. (”password”. dtglobalsheet) Dialog”Login”.WinEdit(“Password).

Local & Location)- Tuesday.Using Data Sheet (Global. August 12. 2008 Ashish Kumar Srivastava 34 .

August 12.Setting the Parameter Value- Tuesday. 2008 Ashish Kumar Srivastava 35 .

Test Results Iterations- Tuesday. August 12. 2008 Ashish Kumar Srivastava 36 .

2008 Ashish Kumar Srivastava 37 . August 12. Types of Exception Handling: 1) Popup Exception Handling 2) Object State Exception Handling 3) Test Run Exception Handling 4) Application Crash Tuesday.Exception HandlingIt enables Quick test to detect and handle when unexpected error occurred during execution time.

August 12. 2008 Ashish Kumar Srivastava 38 . Two types of properties are their in object Identification: 1) Mandatory Properties 2) Assistive properties Tuesday.Object IdentificationBy using object identification we can map “customer user defined object” to “standard Class”.

Ordinal IdentifierBy 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 Tuesday. 2008 Ashish Kumar Srivastava 39 . August 12.

Two properties are available in Smart identification They are1) Base Filter Properties 2) Optional Filter Properties Tuesday. it is change randomly.Smart IdentificationQuick test unable to identify the object. August 12. 2008 Ashish Kumar Srivastava 40 . To identify such object we need to use Smart Identification.

August 12. There are 4 types of synchronization points: 1) Sync 2) Wait.Synchronization PointSynchronization point maintains the time coordination between testing process and your application process. 2008 Ashish Kumar Srivastava 41 . wait(5) or wait 5 3) Wait Property 4) Exist Tuesday.

2008 Ashish Kumar Srivastava 42 . we have 2 types of run modes1) Normal 2) Fast Tuesday.QTP Test Run ModesIn QTP. August 12.

August 12. 2008 Ashish Kumar Srivastava 43 .Regular ExpressionsIt 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….etc Tuesday.

Using a Regular Expression- Tuesday. August 12. 2008 Ashish Kumar Srivastava 44 .

2008 Ashish Kumar Srivastava 45 . * + [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 Tuesday. August 12.Some Regular ExpressionsExpression Period Asterisk Plus Brackets Char .

Close Tuesday. Dialog(“text:=Login”). Set “88888” .=Login”).wineidt(“attached text:= Password”). we need to use a technique called as descriptive programming.Descriptive ProgrammingWithout using the object repository test engineer can develop automation test in this particular accept. August 12.Activate Dialog(“text. 2008 Ashish Kumar Srivastava 46 . Script: Dialog(“test:=Login”). Set “Axisitt” Dialog(“text:=Login”).wineidt(“attached text:= Login name”).

2008 Ashish Kumar Srivastava 47 .How to work with Environmental variables- It is a special type of variable which is use to expose the data related to environment. August 12. Environment Variables Built In user defined Internal External Tuesday.

       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 Ashish Kumar Srivastava 48 Tuesday. August 12. 2008 .

Comments & QueriesQueries are always welcome. Tuesday. 2008 Ashish Kumar Srivastava 49 . August 12.

-It will help us to improve in next sessions. August 12. Tuesday.. Thanks & Happy Testing.Feedback- -Please spend few minutes from your valuable time to provide your feedback. 2008 Ashish Kumar Srivastava 50 .