how to recognize menu options in dp in qtp - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: how to recognize menu options in dp in qtp (/Thread-how-to-recognize-menu-options-in-dp-in-qtp) |
how to recognize menu options in dp in qtp - satyavathi - 01-16-2008 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 RE: how to recognize menu options in dp in qtp - Ankur - 01-17-2008 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 RE: how to recognize menu options in dp in qtp - webapp - 01-17-2008 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". RE: how to recognize menu options in dp in qtp - Rajashekar Gouda - 01-18-2008 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 RE: how to recognize menu options in dp in qtp - Ankur - 01-19-2008 @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" 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" 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. RE: how to recognize menu options in dp in qtp - Rajesh - 01-21-2008 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" 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). RE: how to recognize menu options in dp in qtp - Rajashekar Gouda - 01-21-2008 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" 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.." RE: how to recognize menu options in dp in qtp - Rajesh - 01-21-2008 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 RE: how to recognize menu options in dp in qtp - newqtp - 01-22-2008 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. RE: how to recognize menu options in dp in qtp - Rajashekar Gouda - 01-22-2008 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 |