hope the pgrm is abt printing menus and sub menus try this out
systemutil.run "C:\Program Files\HP\QuickTest
Professional\samples\flight\app\flight4a.exe"
dialog("Login").Activate
dialog("Login").WinEdit("Agent Name:").Set("hello")
dialog("Login").WinEdit("Password:").Set("mercury")
dialog("Login").WinButton("OK").Click
window("Flight Reservation").Activate
mainmenucount=window("Flight
Reservation").WinMenu("Menu").GetItemProperty("","submenucount")
msgbox mainmenucount
For i=1 to mainmenucount
menuindex="<item" &i&">"
msgbox menuindex
itempath=Window("Flight Reservation").WinMenu("Menu").BuildMenuPath(i)
msgbox itempath
msgbox window("Flight
Reservation").WinMenu("Menu").GetItemProperty(itempath, "Label")
submenucount=window("Flight
Reservation").WinMenu("Menu").GetItemProperty(itempath,"submenucount")
msgbox submenucount
For j=1 to submenucount
submenuindex=menuindex&"<item" &j&">"
itempath1=Window("Flight Reservation").WinMenu("Menu").BuildMenuPath(i,j)
msgbox itempath1
msgbox window("Flight
Reservation").WinMenu("Menu").GetItemProperty(itempath1,"Label")
next
Next
On Thu, Aug 25, 2011 at 2:46 PM, madhu <[email protected]> wrote:
> hi guys i am new to this group and also for QTP
> their is problem in this code
>
> systemutil.run ("C:\Program Files\Mercury Interactive\QuickTest
> Professional\samples\flight\app\flight4a.exe")
> dialog("Login").Activate
> dialog("Login").WinEdit("Agent Name:").Set("hello")
> dialog("Login").WinEdit("Password:").Set("mercury")
> dialog("Login").WinButton("OK").Click
> window("Flight Reservation").Activate
> mainmenucount=window("Flight
> Reservation").WinMenu("Menu").GetItemProperty("","submenucount")
> msgbox mainmenucount
> For i=1 to mainmenucount
> menuindex="<item" &i&">"
> msgbox menuindex
>
> msgbox window("Flight
> Reservation").WinMenu("Menu").GetItemProperty(menuindex , "Label")
>
> submenucount=window("Flight
> Reservation").WinMenu("Menu").GetItemProperty("","submenucount")
> For j=1 to submenucount
> submenuindex=menuindex&"<item" &j&">"
> msgbox window("Flight
> Reservation").WinMenu("Menu").GetItemProperty(submenuindex,"Label")
> next
> Next
>
>
> getting an error at
> msgbox window("Flight
> Reservation").WinMenu("Menu").GetItemProperty(menuindex , "Label")
> and the error is
> Object's physical description menuobjtype=2
>
>
> can any plz help me out of this error
>
> --
> You received this message because you are subscribed to the Google
> "QTP - HP Quick Test Professional - Automated Software Testing"
> group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/MercuryQTP?hl=en
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en