Micro Focus QTP (UFT) Forums

Full Version: How to Write Descriptive Programming for Menu Items
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All,
This is kamakhi.can any one help me how to write descriptive programming for Menu Iteams.e.g in a Flight Reservation Application,I want to click on Fax order by navigating File-->Fax Order..
so how to write???

Thanks and Regards.
Kamakhi
'Invoking the Application
Code:
invokeapplication"C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe"

'Loginging to the Application
Code:
Dialog("text:=Login").WinEdit("attached text:=Agent Name:").Set "sridhar"
Dialog("text:=Login").WinEdit("attached text:=Password:").SetSecure "47e2b30da686ac4f243e9c695c64fa76c5931577"
Dialog("text:=Login").WinButton("text:=OK").Click

'Opening a particular order
Code:
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

So Explore this script according to your needs..

Regards
Sridhar
to select File from Menu, Object Spy will not give its propery name and value....
how do I know its property name is menuobjtype as u specified for File menu

Code:
window("text:=Flight Reservation").winmenu("menuobjtype:=2").Select "File;Open Order..."
----------------------------------------------------------------------