Monday, May 9, 2011

Anatomy Of QTP

For simple understanding of QTP I have divided QTP in the following parts   

1.Test Pane:
Test pane is an area provided by QTP, which is used for developing, viewing, and modifying the test screen. It represents the test scripts in two views
(a). Expert view: It represents the script in VB script format
(b). Key word view: Keyword view represents the script using a graphical user interface (GUI) which is further divided in to four parts.
Ø      Item
Ø      Operation Value
Ø      Documentation

2.Active Screen:
Active screen is an area provided by QTP, which holds the snapshots of each and every script statements and used for the following.
Ø      Easily understanding the script
Ø      Easily enhancing the script.

3.Data-Table:
The date table is originally called as formula1 sheet developed by third party and integrated with QTP.
·               It is used for holding the test data
·               It isolates the test script from the data source.
·               It provides the facility to import the test data from different data sources like excel         files, data base and flat files (a file with out having format)
·               It allows the user to interact with the data directly

Qtp have two data tables
a)Global Data table
b)Action data table

4. Debug Viewer Pane:
Debug viewer pane is an area provided by QTP which is used for viewing, modifying or setting the current values of variables or expressions during the execution break with the help of three Tabs by name Watch expression, Variables and Command

5.Tool- Options:
            All the options available in the menu bar, file tool bar and testing tool bar are known as tool-options.

These are the basic anatomy of QTP.

Add In Manager in QTP

This is a feature provided by QTP which is used for showing all the list of addins,while opening the QTP.So that the user can select the desired addin and then enter  into the QTP, Before the user access the QTP the adding manager will make the QTP compatible with all the selected environments.
                                                                                                                                                                        By default QTP is always compatible with standard window’s environment.
QTP also have the following three built-in addins.
1.Activex
2.Visual Basic
3.Web.
A part from the above add-ins one needs to purchase the add-inns by paying extra cost.

Saturday, May 7, 2011

Object Spy in QTP

Object Spy:


Object spy is a feature provided by QTP which is used for showing the complete objects information like list of properties and their values, list of methodology, syntax for methodology and description of methods then and there on the spot immediately of both test objects as well as runtime objects.

1.Run time objects: All the original objects present in the AUT are known as run time objects
 2.Test objects: Test objects are the reference objects created by the QTP for run time objects, stored in object repository and used by the QTP for the original objects

 

Friday, May 6, 2011

Object Repository


Object Repository:
Object repository is a storage place where one can store the objects information and it also acts as interface between the test script and the AUT(application under test) in order to identify the original objects during execution.
Types of Object Repository:
 There are two types of object repository they are.
Per-Action Repository:
 If at all this type is selected as an object repository then the QTP will be automatically creating and managing an individual repository for every action.
Shared Repository:
  Shared repository has to be created and managed manually once a shared repository to created it can be shared among number of tests.It is reusable and easy to maintain.
1) Collect the objects information in to the object repository
2) Click on export
3) Browse the desired location
4) Specify the file name with .TSR extension
5) Click on save button



Or we can create it through Object Repository Manager  Option available in later version of QTP 9.0

Object Identification in QTP

Object identification:
Object identification is based on four types of properties and an ordinal identifier
 1. Mandatory Properties
 2. Assistive properties
 3. Base-Filter Properties
4. Optional Filter properties

QTP learns the information in the following in case only normal brain:
First of all the QTP will learn all the mandatory properties at a time and then think whether these properties are sufficient to identify the object uniquely. If it feels sufficient then it will stop learning otherwise it will learn the first assistive property and once again stops and thinks whether these properties are sufficient to identify the object uniquely. If it feels sufficient then it stops learning otherwise learns the second assistive property and checks whether these properties are sufficient or not. This process continuous till the QTP satisfies or up to the end of the assistive properties list. At the end of the assistive properties list also if it feels not satisfied then it will finally learn the ordinal identifier and stops learning.

QTP learns the information in the following way in case of smart brain also (smart identification):
  While learning the mandatory properties along with them it will learn the base filter properties, optional filter properties and stores them in the secret place.
It considers the mandatory properties only and check whether these properties are sufficient to identify the object uniquely and repeats the above process.

Note: In the above learning process except base filter properties and optional filter properties all the remaining information learnt will be stored in the object repository.

Whenever the QTP is unable to identify the objects with the help of the properties present in the object repository then the special mechanism provided by QTP to identify the object smartly with some other properties is known as smart identification.

QTP will use the information in the following way to identify the object during execution:
                   First of all QTP will use all the properties present in the object repository except ordinal identifier and try to identify the object. If at all the object is not identified then it will forget about all these properties and freshly enters in to the secret place.
                   QTP will consider all the base filter properties and try to identify the object and forms a list of all the objects that are matched with the base filter properties.
If the list contains only one object then that is the object otherwise it will take the support of first optional filter property and try to match with all the object present in the list and forms a new list of all the objects that are matched with that property and then check whether the list is containing one object or more that one object. If the list is containing more than one object then it will consider the second optional filter property and repeats the whole procedure till the list contains on object or up to the end of the optional properties list.
At the end of the optional filter properties list also if the list is containing more than one object then it will finally go to the object repository and check whether the ordinal identifier is available or not. If at all the ordinal identifier is available it will identify the object roughly using that otherwise HANDSUP.

Ordinal Identifiers:
 There are three types of ordinal identifiers
  1.Location
  2.Index
  3.Creation time



1.Location:
                If at all the location is selected, as an ordinal identifier then the QTP will generate a sequence of numbers from 0,1,2,3 based on the sequence of the objects located in AUT.

2.Index:
                   If at all the index is selected as an ordinal identifier than the QTP will generate the numbers from 0,1,2,3…. Based on the sequence of the programs of the objects.

3.Creation Time (specially for web pages):
                   If at all creation time is selected as an ordinal identifier the QTP will generate the number from 0,1,2,3,… based on the loading time of the web pages