Entering/providing objects information directly into the test script is called discriptive programing.
In this method of script creation, we no need to have Object Repository.
Advantages:1).Discriptive programing based test scripts are faster in execution then repository based test scripts.
2).Scripts are portable (we can run these scripts from any machine easily)
3).Maintenance is very easy (Less amount of resource).
4).We can start test execution process even though application is not ready.
Basically Discriptive Programming is two types:
1).Static Programming: In this style of script generation, we provide objects information directly into the script.
Example:1) Invokeapplication "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe"
2) dialog("text:=Login").Activate
3) dialog("text:=Login").Winedit("attached text:=Agent Name:").Set "gcreddy"
4) dialog("text:=Login").Winedit("attached text:=Password:").Set "mercury"
5) dialog("text:=Login").Winbutton("text:=OK","width:=60").Click
2).Dynamic Programming:In this style of script generation, first we create description objects, provide properties information and use description objects in the test script.
Creating Properties Collection Objects
Set oLogin=description.Create
Set oAgent=description.Create
Set oPassword=description.Create
Set oOk=description.Create
Entering Properties Information into Objects
oLogin("text").value="Login"
oLogin("width").value=320
oLogin("height").value=204
oAgent("attached text").value="Agent Name:"
oPassword("attached text").value="Password:"
oOk("text").value="OK"
Generating Tests using Properties collection Objects
Invokeapplication "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe"
Dialog(oLogin).Activate
Dialog(oLogin).Winedit(oAgent).Set "gcreddy"
Dialog(oLogin).Winedit(oPassword).Set "mercury"
Dialog(oLogin).Winbutton(oOK).Click