Sunday, 25 August 2013

Understanding Descriptive Programming: Part 1

HI Folks..
In This Post I will be describing what is descriptive Programming in using VBScript(QTP), and define the various types of descriptive programming.

What is Descriptive Programing(DP):   Before understanding the DP, we must first know what is Object.
In QTP , Object is anything with a set of properties and methods(functions).
It can be any visual entity displayed on the screen as WebPage,Button,Dropdown(Weblist), all of these are type of Objects.(Although it is not necessary that each object should be visual too, this is done with a specific property .)
Now every object has a set of property with which it is defined, such as a WeButton named as "Submit" will have a set of propertys such as 'name', 'htmlid','innertext','outertext',etc
QTP understanding the entire given script in terms of Objects and the operation performed upon them .
Such as click on the submit button, then within the code we specfiy the object and perform the operation.

now the code might look as

Set buttonObj=Browser("sampleBrowser").page("samplePage").WebButton("Submit")


both of the statments are virtually same.

now if we are not using the DP methods then the properties of the submit button are  stored in Object repositories.and we can directly specify the name and the location of the object.The properties of the submit button are specified within the OR itself and user does not require to provide the information regarding submit button in code .(As shown in the code above).

But When we use the DP the properties through which object is described in the application(Description properties) will be specified within the code.(Without using the OR)

We will be looking deep into the DP in later parts of the Post.

No comments:

Post a Comment