Sunteți pe pagina 1din 8

Confidential. Strictly for internal circulation only.

Day 9

Descriptive Programming
Descriptive Programming
Descriptive Programming is a method of performing operation on
the object which is not there in Object Repository. In this process
object properties will be used in script.
When to use Descriptive Programming
1. If the application is having Dynamic Objects
OR:- Difficult to handle Dynamic Objects using Object Repository

2. When we have more objects to perform operations
OR:- The performance will decrease if object repository is having huge number of

3. If the application is having objects that are adding in the Run Time
OR:- We cant add objects to Object Repository in run time.

4. If we need to start Automation before Build Release
OR:- There is no application to create Object Repository.

5. If Application is having similar type of objects or similar name objects
OR:- Object Repository will create multiple objects with same description

6. Big Team Size
OR:- Shared Object Repository is not changeable by multiple persons at a time.
Maintenance becomes harder if all the team members have created their own
object repositories.
Advantages of Descriptive Programming
1. Version Free
DP:- Script can be executed in any version of QTP without any changes.

2. Code Portability
DP:- Just code is enough run script. We can copy and paste in other
scripts for any other required requirement.

3. Reusing of Properties
DP:- We can assign properties to a global variable and reuse it for same
type of objects.

4. Plug & Play
DP:- Any time scripts will be in ready to run state. No need to worry
about any other settings or files.

5. Just Maintenance of variables
DP:- We can store the object properties in the form of variables in a txt /
vbs file which will be placed in central location. In this case we just need
to maintain that file.
Types in Descriptive Programming
You list the set of properties and values that describe the object directly in a VBScript

You add a collection of properties and values to a Description object, and then enter
the Description object name in the statement.

Set oBrowser = Description.create
oBrowser (micclass).value=Browser
oBrowser (name).value= Google

Set oPage = Description.create
oPage (micclass).value=Page
oPage (name).value= Google
Set oLink = Description.create

oLink (name).value= Login
oLink (index).value= 1

SemanticSpace Technologies
100 Pacifica Suite 270,
Irvine CA 92618,
Tel: (949) 789-7332
Fax: (949) 789-7334
22 Cortlandt Street, 18th Floor,
New York, NY 10007
Tel: (212) 267-7722
Fax: (212) 608-6753
Arsin Corporation
Suite 425, 4800 Great America Parkway,
Santa Clara, CA 95054 -1228
Tel: (408) 653-2020
Fax: (408) 653-2030
Corporate Headquarters
European Offices
London, UK Hamburg, Germany
Philadelphia, PA San Francisco, CA Irving, TX Atlanta, GA Orlando, FL Cleveland, OH
US Offices
Boston, MA
India Office
Plot #226, Road #17
Jubilee Hills, Hyderabad-500033
Phone: +91 40 39991999
Fax: +91 40 23114651