Sunteți pe pagina 1din 109

Quick Test Professional

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

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.

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

Introduction to QTP Developed by Mercury interactive But Now owned by HP Developed for web functionality QTP supports both web applications & windows applications QTP Developed in 2002 Test Script developed on VB Script

QTP supports Languages is

.NET. J2EE, Main Frame, XML,Java ERP-> SAP, Seibel, People soft QTP Supports both Technical & Non Technical People QTP run on only windows platform not supporting UNIX, Linux etc

QTP - Main Window Test Pane: Test Pane contains two labs to view the tests, - Keyword View - Expert View

Keyword View: Quick Test Pro displays your test in the form of a user actions, icon based tree Expert View: Quick Test Pro displays the scripts (VB Script) of the tests in this view.

Overview of QTP Testing Process of QTP Windows Structure of QTP Add Ins of QTP Recording Modes in QTP Object Repository Object Spy Synchronization point Regular Expressions Parameterization Check Points Data Driver Output Values Transaction Breakpoints Virtual Objects Working with Actions Recovery Scenario Manager

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

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

Add In Manager

Recording Modes of QTP

There are three recording modes in QTP 1)Normal Recording Mode 2) Analog Recording Mode 3) Low Level Recording Mode

Record a Test

Record & Run Settings-

Run a Test and Save Results

View Test Results

Object Repository
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)

Open the Object Repository Dialog Box

Object Spy
Object spy is used to display or view all the physical properties and methods of an object or a window based on the requirement.

Synchronization point
Two types: 1. wait() 2. Synchronization point 1. Wait(): pause the test for fixed time specified in the wait statement. 2. Synchronization point :To define the time mapping between the QTP and application, we use this concept. If we dont want to perform any operation until an object in our application achieves certain status then we can insert synchronization point to instruct QTP to pause the test until the object getting the certain value.

Regular Expressions
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.etc

Using a Regular Expression-

Some Regular Expressions

A parameter is a variable that is assigned a value from an external data source at run time. We use parameterization when we want to change the value of properties at run time. Parameterization can be done in three ways using Quick Test. Datatable Environment variables Random numbers A property of an object can be parameterised from the object repository.Select the property to be parameterised and check the Parameter option from the configure vlue frame and enter the value in the data table column.

Setting the Parameter Value

Test Results Iterations

Data Driver method

The Execution of an automation program on a software build with multiple test data is called as "data driven testing.
Data Driven testing is testing the functionality with dynamic input from QTP. When we record, the value we use become static. In Data driven test we convert that static value to dynamic so that we can give as many inputs we want to see the functionality is working of different inputs.

Check Points
Check Point is a verification point that compares the current value of the specified property with the expected value for that property. There are 7 types of check points are available in QTP. They are1) Standard Check Point 2) Text Check Point 3) Text Area Check Point 4) Bitmap Check point 5) Database Check Point 6) XML Check Point 7) Accessibility Check Point

Checkpoint Types

Standard Check point

1.Open a blank test. 2. Make sure that Flight application is open. (Now only QTP with blank test and Flight application should be open). 3. Click on Record. When we click on Record, "Record and Run Settings" window opens up. Go to "Windows Applications" tab and choose first option "Record and run test on any open Windows based application." and click ok. 4. Go to Insert (menu)->Checkpoint->Standard Checkpoint (or press F12).The mouse pointer will become hand and QTP will be minimized. 5. Click on the "Flights..." button which is on the Right Hand Side of the "Fly To" combo box in the Flight application.

6. It will open "Object Selection - Checkpoint Properties" window (with WinButton:FLIGHT highlighted). Click ok.
7..It will open checkpoint properties window. (only one property will be checked in it i.e. 'enabled' with a value of False.) 8. Click ok. Click on Stop in order to stop the Recording & Save the test

Text Checkpoint - It is used for checking the Text present on a object. It can be inserted through application as well as through active screen. Text Area Checkpoint - It is used for checking the test present in a specified area. It can be inserted only through application but not through active screen. Data Base Check Point -It is used for checking the contents of a database. 6) XML (Extended Markup Language) Checkpoint It is used for checking the contents of an XML file. It is a universally understandable language and used for data transformations. Accessibility Checkpoint - It is used for checking whether the page can be accessible by more number of people or not. In order to check the same actually it checks whether the page is developed according to the WWW (world wide web Consorted) standards or not.

Output Values
Output Value is used to retrieve the current value of any object in the application and stores it in a specified location. Output values can be added in the following ways During Recording: In the Keyword View or Expert View, choose Insert -> Output Value and select the type of output value and the object for which the value is to be outputted. During Editing: Right click the object in the Active screen and select the type of output value to be added.If the location clicked is associated with more than one object, then the Object Selection Output Value Properties dialog box opens. From here select the required object.

Transaction in used for performance analysis.
Wherever you want to measure the time taken for any task in your application, start the transaction (Start Transaction) and when the task is done, end the transaction (End Transaction).

The run results will show the time taken between start and end transaction.

Breakpoints are basically used in debugging of the test, when you add breakpoint to a line of code, we can check whats that line of code is doing Operations we can perform on Breakpoints: * Setting Breakpoints * Enabling and Disabling Breakpoints * Removing Breakpoints

Virtual Object
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,16Window(Paint).Winobject(colors).Click 80,14window(Paint).Close 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

Working with Actions

Actions are test units that divide your test in to logical sections. When we create a new test, it contains a call to one action. By dividing your tests into calls to multiple actions, we can design more modular and efficient tests.

Recovery Scenario Manager

The Recovery Scenario Manager provides a wizard that

guides you through the process of defining a recovery scenario, which includes a definition of an unexpected event and the operations necessary to recover the run session.
Pop-up window Test run error

pop-up window
To handle unwanted windows of application build at runtime we can use this event

Test run error

To handle vb script statement errors at runtime we can use this event

Thank You