Wednesday, December 15, 2010

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 "asdf"

Dialog(oLogin).Winedit(oPassword).Set "mercury"

Dialog(oLogin).Winbutton(oOK).Click

Note1: Create Description objects and put into one library file, by associating that library file, we can generate tests.

Note2: Dynamic programming is some difficult in preparation than static programming but maintenance is very easy.

In this style of script creation also, we can maintain Objects information in the Centralized location by putting collection objects in a Library file.