Wednesday, December 2, 2009

36. Descriptive Programming:

It is nothing but a technique using which operations can be performed on the AUT object. Which are not present in the Object Repository.
There are two Types of Descriptive Programming.
1. Static Descriptive Programming.
2. Dynamic Descriptive Programming.


36.1. Static Descriptive Programming:
We provide the set of properties and values, which describes the object, directly.
Step 1: Open the Test in the Qtp.
Step 2: Open the application that you want to write the Script.
Step 3: Identify the properties for the applications option by using Object Spy.
Step 4: Enter the script as, this below Example uses Descriptive Programming to open Flight Application and does not use object Repository at all. So one of the other advantage is you can copy this script and run this from any other machine (other that on which it was created) and it is supposed to work fine.
E.g: Dialog(“text:=Login”).winedit(“attached text:=Agent Name:”).set “Arcus”
Dialog(“text:=Login”).winedit(“attached text:=Password:”).set ”mercury”
Dialog(“text:=Login”).winbutton(“text:=OK”).click
Step 5: Execute the script to analyse the Result.

36.2. Dynamic Descriptive Programming:
Step 1: Open the test in QTP.
Step 2: open the application that you want to write the Script.
Step 3: Identify the properties for the applications option by using Object Spy.
Step 4: Enter the script as, This below Example uses Descriptive Programming to open Flight Application and does not use object Repository at all. So one of the other advantage is you can copy this script and run this from any other machine (other that on which it was created) and it is supposed to work fine.
Step 5: Enter the Script as
Set dianame=Description. create
Dianame(“text”).value=”Login”
Set agname=Description.create
Agname(“attached text”).value=”Agent Name:”
Set pwd=Description.create
Pwd(“attached text”).value=”Password:”
Set but=Description. create
But(“text”).value=”OK”
Dialog(dianame).winedit(agname).set”Arcus”
Dialog(dianame).winedit(pwd).set”mercury”
Dialog(dianame).winbutton(but).click
Step 6: Execute the Script and analyze the Result.

No comments:

Post a Comment