How To Use Descriptive Programming in QTP

You might have found the question about descriptive programming a lot of times in the QTP forums. I will try to explain this to you with the following code.

This code uses data driven Automation framework where we also use shared object repositories. Also modifying the same will require me to change its name and could also hamper the smooth execution of previously created scripts.

I use the Object spy to identify the mandatory properties of the objects

dim varCombo ‘Declare the Variable
Set varCombo = Description.Create

varCombo(“window id”).value = “100″ ‘setting up the mandatory properties to the above created Variable
varCombo(“nativeclass”).value=”Edit”
varCombo(“location”).value=”10″

I use this code snippet before I use the variable in my script. Its similar to declaring an object before using it(as in any other object oriented language).

Hope this helps.

Cheers!

Related posts:

  1. Secure PHP Programming!
  2. How to: Embed wave file in C#
Tags: , , , , ,
Subscribe to Comments RSS Feed in this post

One Response

  1. very instructive post, thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*

Get Adobe Flash playerPlugin by wpburn.com wordpress themes