Sunday, February 28, 2010

Descriptive Programming

Descriptive Programming: This is to write and run a QTP script without adding objects in object repository

Ex(1): Write a DP script to log into Flight reservation application
Note: Flight reservation application comes with QTP default

Dialog("text:=Login").Activate
Dialog("text:=Login").WinEdit("Attached text:=Agent Name:").Set"aaaaa"
Dialog("text:=Login").WinEdit("Attached text:=Password:").Set"mercury"
Dialog("text:=Login").Winbutton("text:=ok").Click

Explaination:
Consider the above example,
The objects are identified with the properties and values in QTP(By physical description)
In Dialog("text:=Login"), text is a property and Login is a value. same way for WinEdit("Attached text:=Agent Name:"), Attached text is a property and Agent Name is a value