Pages

Monday, July 1

Descriptive Programming in QTP - Part 1

In this series of post, we'll learn in detail how to use Descriptive programming (DP) in QTP.

Before starting DP, let's understand the basics about object identification. There are two ways, QTP uses to recognize the objects present in your application.

1. Object Repository (OR)
2. Descriptive Programming (DP)

What is Object Repository (OR)?

OR is the simple and default way of object identification in QTP. Object Repository is a storage place of QTP, where properties and values of every object are stored. While you record on application, all the objects you click/interact, are stored in Object Repository.

During the play back QTP use this OR to identify the object on which the action is to be performed.

What is Descriptive programming (DP)?

We'll use DP when we want to bypass OR. Descriptive programming is used when we want to perform an operation on an object that is not stored in the object repository. This way QTP won’t search for the object properties in the Object Repository, but will take it from the DP statement.

Why use Descriptive programming (DP)?

Everything looks fine while automating test using OR, then why should I use DP?

Well, there might be many valid reason to do so. Think about a situation - you want to close all opened browser automatically before you start executing your script. Here OR will not help you to identify an object as it is not possible to store all the opened browser objects into OR. Make sense?