Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to recognize menu options in dp in qtp
#21
Solved: 11 Years, 4 Months ago
Hi Raj
Following sample code for Flight reservation using DP

Code:
SystemUtil.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4b.exe"
window("Title:=Login").WinEdit("AttachedText:=Agent Name:").Set "sachin"
window("Title:=Login").WinEdit("AttachedText:=Password:").Set "mercury"
window("Title:=Login").winbutton("Text:=OK").Click
window("Title:=Flight Reservation").close
Reply
#22
Solved: 11 Years, 4 Months ago
Can anyone say why objectspy is not identifying the menu of flight application.Then how come i write the script using DP.
pls gimme reply who ever knows
Reply
#23
Solved: 11 Years, 4 Months ago
Hi Hari,

i got a problem with the menu item in dp.
Here is the code.

Code:
Invokeapplication "notepad.exe"

Window("text:= Untitled - Notepad").WinMenu("text:=&File").Select "<item 3>"     'File->save  ERROR: "Cannot identify the specified item of the [ WinMenu ] object. Confirm that the specified item is included in the object's item collection."

'Window("text:= Untitled - Notepad").WinMenu("File").Select "<item 3>"  "Is also not working Error: The "File"/"ContextMenu"  object was not found in the Object Repository.
Check the Object Repository to confirm that the object exists or to find the correct name for the object."
Details: Window("text:= Untitled - Notepad").WinMenu("File").Select "<item 3>"

Window("text:= Untitled - Notepad").dialog("text:=Save As").Wincombobox("attached text:= Save &in:").Select "desktop"
Window("text:= Untitled - Notepad").Dialog("text:=Save As").Winedit("attached text:= file &name:").click
Window("text:= Untitled - Notepad").Dialog("text:=Save As").Winedit("attached text:= file &name:").Set  "vasu"
Window("text:= Untitled - Notepad").Dialog("text:=Save As").Winbutton("text:=&save").click
Window("text:=Vasu - Notepad").Close


Is there any mistake in my script.

Please update the script.

Thanks in advance.
Reply
#24
Solved: 11 Years, 4 Months ago
Code:
'Window("text:= Untitled - Notepad").WinMenu("File").Select "<item 3>"
"Is also not working Error: The "File"/"ContextMenu" object was not found in the Object Repository.
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"
'this one
'is not working .

Thanks in Ton.
Reply
#25
Solved: 11 Years, 4 Months ago
Thanks to all.Smile
I've got the solutions of my problem..
Code:
window("text:=Flight Reservation").winmenu("menuobjtype:=2").Select "File;Exit"
or
Code:
window("text:=Flight Reservation").winmenu("menuobjtype:=2").Select "Analysis;Graphs..."
Or
Code:
window("text:=Flight Reservation").winmenu("menuobjtype:=2").Select "Analysis;Reports..."

Here winmenu("menuobjtype:=2) for all the tool button will be used..like file,edit,Analysis,Help.

Cheers!!
Reply
#26
Solved: 11 Years, 4 Months ago
Here is my suggestion based on my understanding from the above matter. Try to use some other way of doing (clicking) 'New Order' through clicking Application icons or through short cut keys available if any. For this, this could be a quick solution.
In Programmatic QTP recording:
Code:
Dialog("text=Flight Reservation").WinMenu("Menu").Select "File;New Order"

In DP:
Code:
window id:=6 -> New Order; window id:=1 -> Reports button on the Flight Reservation window.
Window("text:=Flight Reservation","regexpwndtitle:=Flight Reservation").WinButton("nativeclass:=Button", "window id:=6").Click
Window("text:=Flight Reservation","regexpwndtitle:=Flight Reservation").WinButton("nativeclass:=Button", "window id:=1").Click
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Unable to recognize objects in SilverLight application through QTP Guest877 1 2,653 08-03-2018, 08:33 AM
Last Post: Manisha
  When trying to recognize the object in QTP, each object is recognized as “WinObject:S geetasarvadnya 2 3,765 10-28-2015, 12:34 PM
Last Post: vinod123
  QTP does recognize object chadadus 7 4,556 09-05-2014, 01:16 AM
Last Post: chadadus
  QTP 11 and IE9 64bit on Win7&SP1 64bit, QTP does not recognize objects in website jpalos 4 8,710 08-27-2014, 10:11 AM
Last Post: vinod123
  Handling .NET framework menu in webpage using QTP 10 vishnu1067 0 2,332 05-15-2014, 05:30 PM
Last Post: vishnu1067

Forum Jump:


Users browsing this thread: 3 Guest(s)