Descriptive Programming Examples

UFT Descriptive Programming Examples

Assignment 1:
-----------------------------------------------------------

1) Write Descriptive Programming for Open Order functionality in Flight Reservation

Base State: Flight Reservation window

Steps/navigation:

a) Activate the Flight Reservation window

b) Select File Menu and Choose "Open Order" item

c) Check Order No check box

d) Enter Order No

e) Click OK Button
-----------------------------------------------------------
Solution:

SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\flight\app\flight4a.exe"
window("text:=Login").Activate
window("text:=Login").winedit("attached text:=Agent Name:").Set "user1"
window("text:=Login").winedit("attached text:=Password:").Set"mercury"
window("text:=Login").WinButton("text:=OK").Click

window("text:=Flight Reservation").Activate
window("text:=Flight Reservation").winmenu("menuobjtype:=2").Select "File;Open Order..."
Window("text:=Flight Reservation").Dialog("text:=Open order").Click
window("text:=Flight Reservation").Dialog("text:=Open order").WinCheckbox("text:=&Order No.").Set"ON"
window("text:=Flight Reservation").Dialog("text:=Open Order").WinEdit("Window id:=1016").Set "4"
window("text:=Flight Reservation").Dialog("text:=Open Order").WinButton("text:=OK").Click
-----------------------------------------------------------

'Descriptive programming for Gmail Login Functionality

SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe", "www.gmail.com"
Browser("CreationTime:=1").Page("title:=Gmail").WebEdit("name:=Email").Set "gcr1977"
Browser("CreationTime:=1").Page("title:=Gmail").WebEdit("name:=Passwd").SetSecure "5386840e371bce8f9bc92cd8d1f4adf93ca93ad549a8b041e7d780eebd21"
Browser("CreationTime:=1").Page("title:=Gmail").WebButton("name:=Sign in").Click
 

0 comments:

Post a Comment