02-21-2008, 08:54 PM
Code:
'Window("text:= Untitled - Notepad").WinMenu("File").Select "<item 3>"
Check the Object Repository to confirm that the object exists or to find the correct name for the object."
Details:
Code:
Window("text:= Untitled - Notepad").WinMenu("File").Select "<item 3>"
In this line the parent object Window("text:= Untitled - Notepad")is defined as DP and Qtp is looking childobject winmenu("file") in OR.That's why you are getting error.
Now I've a questions to all.I'm using DP for flight reservation application and i want to select menu object file then exit.
Here is the code
Code:
'invokeApplication"C:Program FilesMercury InteractiveQuickTest Professionalsamplesflightappflight4a.exe"
window("text:=Login").Activate
window("text:=Login").winedit("attached text:=Agent Name:").Set "kirti"
window("text:=Login").winedit("attached text:=Password:").SetSecure"mercury"
window("text:=Login").WinButton("text:=OK").Click
window("text:=Flight Reservation").Activate
'window("text:=Flight Reservation").winmenu("menuobjtype:=1").Select "File;New Order..." 'these are working
'window("text:=Flight Reservation").winmenu("menuobjtype:=2").Select "File;Open Order..."'this one is also work
Window("text:=Flight Reservation").winedit("acx_name:=MaskEdBox").Set "11/11/11"
window("text:=Flight Reservation").Type micTab
window("text:=Flight Reservation").WinComboBox("attached text:=Fly From:").Select "Denver"
window("text:=Flight Reservation").Type micTab
window("text:=Flight Reservation").WinComboBox("attached text:=Fly To:").Select "London"
window("text:=Flight Reservation").WinButton("text:=Flight").Click
dialog("regexpwndtitle:=Flights Table").WinButton("text:=OK").Click
'window("text:=Flight Reservation").winmenu("menuobjtype:=2").Select "File;Open Order..."
'window("text:=Flight Reservations").winButton("text:=&Yes").Click
'window("text:=Flight Reservations").winButton("text:=OK").Click
window("text:=Flight Reservation").winedit("window id:=1014").Set "shek"
window("text:=Flight Reservation").winradiobutton("text:=First").Click
window("text:=Flight Reservation"). winButton("text:=&Insert Order").click
'window("text:=Flight Reservations").WinButton("text:=OK").Click
wait(8)
window("text:= Flight Reservation").winbutton("text:= &Delete Order").Click
dialog("text:=Flight Reservations").winbutton("text:= &Yes").Click
window("text:=Flight Reservation").winmenu("menuobjtype:=4").Select "File;Exit"
'is not working .
Thanks in Ton.