Monday, June 23, 2008

QTP - Descriptive Programming

QuickTestProfessional help refers Descriptive Programming as Programmatic description. Below given few info about Descriptive Programming.

Using Object Repository
When you record an operation on an object, QuickTest adds the appropriate test object to the Object Repository. Once the object exists in the Object Repository, you can add statements in the Expert View to perform additional methods on that object. To add these statements, you usually enter the logical name of each of the objects in the object's hierarchy as the object description, and then add the appropriate method.

Descriptive Programming (Programmatic Description) Usage
Programmatic description can be very useful if you want to perform an operation on an object that is not stored in the Object Repository. You can also use programmatic descriptions in order to perform the same operation on several objects with certain identical properties, or in order to perform an operation on an object whose properties match a description that you determine dynamically during the test run.

There are two types of programmatic descriptions:

  1. Static . You list the set of properties and values that describe the object directly in a VBScript statement.
  2. Dynamic . You add a collection of properties and values to a Description object, and then enter the Description object name in the statement.

Using the Static type to enter programmatic descriptions directly into your statements may be easier for basic object description needs. However, in most cases, using the Dynamic type provides more power, efficiency, and flexibility.

Useful Links :
Descriptive Programming by QTP Expert Tarun Lalwani

Sample QTP code for Descriptive Programming - Dynamic

Sample QTP code for Descriptive Programming - Static

2 comments:

Dmitry Motevich said...

Hello, Chitra & Palani!

I am impressed by your high productivity on different articles about automated testing!

Great!

Palani Selvam said...

Hi Dmitry Motevich,
First of all, We want to welcome you. I used to see few blogs. Your blog is one of them.

Thanks for your comments. We will be continuing the same.