Dynamic Descriptive Programming

Dynamic Descriptive Programming

Descriptive Programming or Programmatic Descriptions is one of the method to Create Tests in UFT (Formerly QTP).

Descriptive Programming two types

1)    Static Programming
2)    Dynamic Programming

What is Static Descriptive Programming?

Enter or provide Objects Information (Properties and values) directly in the Statements.

What is Dynamic Descriptive Programming?

Creating Description objects and generating Steps or statements using Description objects  is called Dynamic Programming.

Steps for Dynamic Programming:

Step 1: Create Description objects

Syntax:

Set Variable = Description.Create

Example:

Set Login = Description.Create

Step 2: Enter Properties information

Syntax:

Description Object("Property Name").Value = Property Value

Example:

Login("text").Value = "Login"
Login("widt").Value = 320
Login("enabled").Value = True

Step 3: Generate steps or statements using description objects

Syntax:

TestObject(DescriptionObject).Method or Operation

Ex:

Dialog(Login).Activate

Example (Dynamic Descriptive Program for Login Functionality in Flight Reservation Application (Sample Application for UFT Tool).

'Step 1: Create Description objects
Set Login = Description.Create
Set Agent = Description.Create
Set Password = Description.Create
Set Ok = Description.Create

'Step 2: Enter Properties information
Login("text").Value = "Login"
Login("width").Value = 320
Login("enabled").Value = True

Agent("attached text").Value = "Agent Name:"
Agent("window id").Value = 3001
Agent("x").Value = 20

Password("attached text").Value = "Password:"
Password("window id").Value = 2000
Password("y").Value = 119

Ok("text").Value = "OK"

'Generate steps using Description objects
SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\flight\app\flight4a.exe"
Dialog(Login).Activate
Dialog(Login).WinEdit(Agent).Set "abcd"
Dialog(Login).WinEdit(Password).SetSecure "54544e95b4fb079ee14031a38818c2010d7e1348"
Dialog(Login).WinButton(Ok).Click

0 comments:

Post a Comment