Author Topic: Descriptive programming  (Read 2026 times)

Offline ashwini8dalvi

  • Jr. Member
  • **
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Descriptive programming
« on: August 16, 2010, 10:30:26 PM »
What is Descriptive programming

Offline Kanagaraj

  • Full Member
  • ***
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: Descriptive programming
« Reply #1 on: August 16, 2010, 11:05:49 PM »
Descriptive programming: You can write a program directly and execute it without the help of ObjectRepository and by using ObjectSpy.

It is used when:
  • QTp is unable to find/recognize an object.
  • Objects are dynamicaly changing.
  • ObjectRepository size is huge automatically QTP will become slow.

Think this is correct. But guys... if found better than this pls post here.

Thx!
Kanagaraj.K
Not The Best! But Definitely Better!!

advertisement

Offline Mallikarjun

  • Jr. Member
  • **
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Descriptive programming
« Reply #2 on: September 15, 2010, 10:43:27 PM »
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