Can not select an item from a context menu - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming) +--- Thread: Can not select an item from a context menu (/Thread-Can-not-select-an-item-from-a-context-menu) |
Can not select an item from a context menu - donde - 08-25-2009 Hi all, Does someone knows how I can select an element from a context menu? I use this script: 'After a right click on the element "jive-doc-copy-link", a conext menu is opened and I want to select the item "Copy" from it. Code: replaytype = Setting.WebPackage("ReplayType") I can not add it in the OR manually and I do not know how I can do it descriptively, because I do not know any of its properties. Is someone familiar with this? Thank you in advance and best regards. RE: Can not select an item from a context menu - basanth27 - 08-25-2009 First, Please unbold the charachters. Bold only those you want to highlight. Context menu's cannot be added to the OR because the object properties are lost as soon as the menu dissapears and no context menu stays there. There are 2 ways of doing it, 1. Record the action you want to do ?? Have you tried this yet ? IF the application supports it will record the object in the Local Repository. Once the recording is done export it to the shared OR. 2. While adding the object from the OR, the moment you click on the pointing hand, hold the ctrl key and perform the action on the application until the context menu appears. Release the ctrl key and click on it. 50% chances are that the object will get captured with some properties. But that is a total risk. I suggest try the first one. If it does not work, try the second one. If both do not work, post your findings back and we will work through a solution. RE: Can not select an item from a context menu - donde - 08-25-2009 Hi basanth27, Thank you first for the answer and sorry for the bold characters. I have tried of course, first to record this (including the right click on the element), but it did not work. Then I configured the xml file for Web Event Recording Configuration in QTP, but again it did not work. Now, with the code above I was able to perform the right click, but nothing more. I can not select an item from the context menu. I tried the solutions that you suggest, but they do not work for me. With pressing CTRL key, the context menu was identified as a Window (with no properties) and it seems that I can not use the method Select for the object Window. What can you advise me Regards. RE: Can not select an item from a context menu - basanth27 - 08-25-2009 Search this forum for DeviceReplay. I am sure it will help you. RE: Can not select an item from a context menu - Ankur - 08-25-2009 Once you highlight an element you can use Send Keys. For right click use "+{F10}" In case the menu offers a shortcut use that, else use {DOWN n} where 'n' is the position of 'Copy' element. RE: Can not select an item from a context menu - Saket - 08-25-2009 QTP does not like (does not support) context menu also right click as well and so you will not be able to do anything directly with this. But definitely we can do this by other ways. I can suggest one of the way could be - Note the position of your required item (2,3..) do Right click using device replay or your preffered way. traverse thru menu using sendkeys up or down select the option using sendkeys Enter. Try this, see if it helps you |