Tuesday 29 November 2011

Introduction to QTP

QTP
-----
It is Quick Test Professional often referred  as Quick Test which is a functional automation tool Created
by HP subsidiary Mercury Interactive that allows the automation of user actions on web or desktop application.

Generally it uses VB script to manipulate with the objects.VB Script functionality is available in the QTP Expert View.

QTP has two modes in which we can edit and view a test script

a)Keyword View
b)Expert View

Keyword View
----------------
It displays the script in the form of keywords arranged in a tree format.

Expert View
------------
It gives us a clear picture about the Vb script code .

Features of QTP
----------------

a)Record and Playback feature can be easily implemented .

b)Run time Checking of application objects and Data using various check points.

c)It Supports both Data Driven testing and Keyword Driven Testing features .

d)Easy and effective programming using Vb Script in Expert view. etc.

e)It can handle errors in a proper manner through recovery scenario.

f)It Supports XML,excel for inputting data and for exporting our results.

Supported Technologies:
------------------------

Web,Java,.Net,SAP,Oracle,Siebel,People Soft,Delphi,Flex etc..

QTP Versions
-------------

11.0 - Released in 2010 (Latest Version)
10.0 - Released in 2009
9.5 -  Released in 2008
9.2 -  Released in 2007
9.1 -  Released in 2007
9.0 -  Released in 2006
8.2 -  Released in 2005
8.0 -  Released in 2004
7.0 -  Never released.
6.5 -  Released in 2003
6.0 -  Released in 2002
5.5 -  First release. Released in 2001

Automation Process in QTP
--------------------------
--Analyse the Application.
--Create Object Repository(OR).
--Create Test Script..
--Run test Script
--Analyse Results.

Drawbacks of QTP
-----------------
a)It does not support Usability Testing

b)Cost for License is  high.

c)It Cannot run multiple threads at a time.

Wednesday 23 November 2011

How QTP Recognises Objects

Before going to the details of how QTP recognises an Object, let's have a brief idea about what an Object is. As we have covered (with the assumption of all have covered) Object Oriented Programming Concept(OOPS), all must have known that an Object is a run time entity (though all must have jaded with this definition) which has a physical existence. Same applies to QTP Objects. Some examples of QTP objects for let say a web application may be Check Box,Radio Button,Web Button,Combo Box etc.

There are two types of object in QTP such as Test Objects and Run Time Objects. Test Objects are those objects which are stored in the repository during a recording session. All the properties (along with their values) associated with an object are stored during recording session in the object repository. Properties of an object may be, for instance Name, Title, Value, HTML Tag etc. Run Time Objects, on the other hand are the actuals objects in the application which QTP encounters during a run session on which methods are performed. Property values of a Test Object are matched with the Propery values of the corresponding Run Time to identify an Object.

For each object class, QuickTest learns a set of properties when it records and it uses this description to identify the object when it runs the test. For example, by default, QTP learns the HTML Tag, Name, and Type of each Web Button on which we record an operation. If the above three Mandatory properties values are not sufficient to uniquely identify the Web Button within its parent object, QuickTest adds some assistive properties and/or an ordinal identifier to create a unique description. Assistive property for the Web Button may be Value, Innertext, Outertext etc. An ordinal identifier may be the Index or Location.

Now, for explaining how QTP recognises an object having some of its properties values stored in the repository, let us correlate how we human being recognise a person we have met before. Suppose you have met Mr. X some years ago. At that time you had marked some of his physical appearance or structure like his approximate height, complexion, eye color, hair style, voice, facial appearance etc. Here your gray matter works as the repository where you stored all the attributes of Mr. X. Now if you have to identify Mr. X from a group of say 50 people, you will try to recall all the attributes that you have marked during your previous meeting. Since you are meeting after a long gap, Mr. X might have lost all his hair and hence you cann't identify him by just recalling his hair style or there may be more than one person whose height and complexion match with that of Mr. X and hence it is diffucult for you to recognise him by the attribute height and complexion. But now, atleast you have a rough idea about who may be Mr. X among 50 people, though you are not sure. When you recall his facial appearance and listen to his voice you are able to recognise Mr. X easily.

This is what exactly happens when QTP has to recognise an object. It reads the property values stored in the repository, and tries to identify it. If QTP does not able to identify an object by the property values stored in the repository, it invokes a mechanism called Smart Identification Mechanism (SIM) which further checks with some more properties values. If still it can not identify the object, it throws an error saying Object can not be identified.