Why do we go for Descriptive Programming?
Many a times this question is posted on the various QTP Forums. Taking a practical example from my project i will try to illustrate why we go for Descriptive Programming.
My Project uses data driven Automation framework where we use the shared object repositories as well. The repositories are created after which there is always some addition of Objets on the same screens from AUT. So next time when i go for scripting the same screen i need to identify the newly added objects but i can not change the Object repositories as well as modifying the same will require me to change the name of the it and can hamper the smooth execution of previously crated scripts.
And so here comes into picture a handy feature of the QTP called DP(Descriptive Programming). So what i do exactly?
Through Object spy , I identify the mandatory properties of these Objects and write a code which looks like:
dim EdPartCombo 'Declare the Variable
Set EdPartCombo = Description.Create 'After this line we are setting up the mandatory properties to the above created Variable
EdPartCombo("window id").value = "1001"
EdPartCombo("nativeclass").value="Edit"
EdPartCombo("location").value="0"
and i put this code just before using the "EdPartCombo" in my script for the first time. So while executing the script when
QTP finds the above code it creats the Object and assigns the described properties to the same and uses this object in the script execution.
Tuesday, 15 July 2008
Subscribe to:
Comments (Atom)