Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to recognize menu options in dp in qtp
#1
Solved: 11 Years, 4 Months ago
Hi, I am new to this site, i have a small query, can u help me how to recognize menu options in descriptive programming in qtp. for example in flight reservation window there is File and open order options, what properties are to be use for retreiving them
Reply
#2
Solved: 11 Years, 4 Months ago
Are you able to identify the menu item through normal recording? If yes, then use the same properties to identify objects through DP also.

More on Descriptive Programming
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#3
Solved: 11 Years, 4 Months ago
Hi Ankur,

I have the same problem. I am not able to identify the menu item through normal recording. For example-- I want to clear cache for a application in IE-6. I select Tools from the menu, which is getting recorded. But I am not able to select Internet options under Tools. The script is throwing an error "The Internet Options object was not found in the Object Repository".
Reply
#4
Solved: 11 Years, 4 Months ago
Really very big thanks to asking such good and wonderful question, I am working in automation since 8 month by using QTP 8.2, I have not thought such things. When I saw this question day before yesterday, I just tried in DP but I was unable to find the solution and neglected. Once again I took seriously and since morning I was trying to find the solution, I tried to use the DP in all manner (I used object spy in normal and low level mode) but was getting error “cannot find the ---objects……”.

So finally what I did is I recorded and play bake in normal mode then also I was getting the same error.

Lastly I tried with analog method of “Record Relative to the screen”, and was able to perform some action like clicking “New Order” and “Open Order” menu options of Flight Reservation.

Even just “Record and play” is working for performing some actions like “New Order” and “Open Order” menu options of Flight Reservation.

But it is not possible to create a new folder in favorites in IE unless other wise u use Analog Recording

As of now I feel that is only one question and I want to know how can we do perform the same actions in case of DP.

I guess this is one of the best interview question as I felt.

Please if any body know how can we perform the above said action in DP.. pls share ur view here.

Regards
Raj
rhotur@gmail.com
Reply
#5
Solved: 11 Years, 4 Months ago
@Satyavathi, webapp, Rajashekhar:

Here is a sample recording for your reference. Use VB and ActiveX add-in only, since this is a windows based application.

Normal Recording:
Code:
SystemUtil.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe","","C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\","open"
Dialog("Login").WinEdit("Agent Name:").Set "mercury"
Dialog("Login").WinEdit("Agent Name:").Type  micTab
Dialog("Login").WinEdit("Password:").SetSecure "4791e267c9e855ee42eecb1f216641f320bd96f9"
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").WinMenu("Menu").Select "File;New Order"
Window("Flight Reservation").WinMenu("Menu").Select "Analysis;Reports..."
Window("Notepad").Close
Window("Flight Reservation").Close

In Descriptive Programming: I have only changed the first line to DP for your understanding. You can change the all the lines and check by yourself.
Code:
SystemUtil.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe","","C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\","open"
Dialog("text:=Login", "nativeclass:=#32770").WinEdit( "nativeclass:=Edit", "attached text:=Agent Name:").Set "mercury"
Dialog("Login").WinEdit("Agent Name:").Type  micTab
Dialog("Login").WinEdit("Password:").SetSecure "4791e267c9e855ee42eecb1f216641f320bd96f9"
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").WinMenu("Menu").Select "File;New Order"
Window("Flight Reservation").WinMenu("Menu").Select "Analysis;Reports..."
Window("Notepad").Close
Window("Flight Reservation").Close

Both codes above are working fine and there is no problem in recognizing the menu options.

@Rajashekhar: A word of advice-- Use analog/low level recording only when you have no other means left to record application. It can create problems with different screen sizes and monitor resolutions.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#6
Solved: 11 Years, 4 Months ago
Hi Ankur,

This site is very much helpful for everyone.
Thanks a lot for solving all our issues.

I did try in the same way how you explained above. I dont know how can we write
WinMenu("Menu") in descriptive programming method.

Code:
SystemUtil.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe","","C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\","open"
Dialog("text:=Login").WinEdit("attached text:=Agent Name:").Set "rajesh"
Dialog("text:=Login").WinEdit("attached text:=Password:").Set "mercury"
Dialog("text:=Login").WinEdit("attached text:=Password:").Type  micReturn
Window("text:=Flight Reservation").WinMenu("Menu").Select "File;New Order"
Window("text:=Flight Reservation").WinMenu("Menu").Select "Analysis;Reports..."

Here the last two lines of the script is not running, reason is I used discriptive programming to call the parent {Window("text:=Flight Reservation")} and normal method to call the child.

please let me know how can we call the child object WinMenu("Menu") using descriptive programming.
I did object spy and all the objects has same property (File - New, File - open).
Reply
#7
Solved: 11 Years, 4 Months ago
Rajesh,

ur code is not working fine bcz first part of statement is in DP and second part is in programmatic.

Code:
Window("text:=Flight Reservation").WinMenu("Menu").Select "File;New Order"
First Part Second part

As per my exp both parts(first and second) part sud be either in progmratic or in DP, but not first part is in DP and second part in programmatic.
That is the reason ur code is not working.

If att u want to gor duel program then u can put the first part in programmatic and second part in DP.

see the code here

This is working fine-
Code:
Dialog("Login").WinEdit("attached text:=Agent Name:").Set "rajesh"

This is NOT working fine-
Code:
Dialog("text:=Login").WinEdit("Agent Name:").Set "rajesh"

To answer ur second question,

You wont get the properties by spy for the option which will be there under main menu options like in IE--menu--"Favorites"--"Add to Favorites.."
Reply
#8
Solved: 11 Years, 4 Months ago
Hi Rajashekar,

Thanks for your comment, I know that the last 2 lines of the script wont run and the reason is as u said.
now my issue is, how can we write descriptive programming for the line "Window("text:=Flight Reservation").WinMenu("Menu").Select "File;New Order"

I don't know how to use Descriptive programming for WinMenu("Menu").
If possible can you give me some ideas.

Thanks,
Rajesh
Reply
#9
Solved: 11 Years, 4 Months ago
I've tried the same code and tried object spy to spy File menu but not able to spy the menu object property instead of it shows Flight reservation properties.
Reply
#10
Solved: 11 Years, 4 Months ago
Yes it is not possible to get the menu object property by spy.So i guess it is not possible to do with DP for menu options. If at all want to test the menu options, as i said the Analog recording the one method

Regards
Raj
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Unable to recognize objects in SilverLight application through QTP Guest877 1 2,669 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,776 10-28-2015, 12:34 PM
Last Post: vinod123
  QTP does recognize object chadadus 7 4,575 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,722 08-27-2014, 10:11 AM
Last Post: vinod123
  Handling .NET framework menu in webpage using QTP 10 vishnu1067 0 2,342 05-15-2014, 05:30 PM
Last Post: vishnu1067

Forum Jump:


Users browsing this thread: 1 Guest(s)