Does anybody know if I want to use silk test to automate the test on popup menu (right mouse click and a menu pops up).
How can I do it without providing the cooridnates?
There is a method called PopupSelect but it requires the use of corridnates which is not useful in my case.
Any help will be appreicated.
Not SilkTest nor any other tool can recognize that "action menu". Coordinates seems to be the only workaround. But there should always be another way to perform the same functionality in a product (Windows Standards). I usually log a bug if that i missing.
The example in SilkTest 5.0 Online Help under PopupMenu Class is something you may want to try. It works sometimes. The problem I reported to Segue is when you use the Cursor.GetPosition () method together with this example, the x and y position returned is way off the item where the popup menu is supposed to be invoked (at least in a PowerBuilder app I am testing).
What kind of AUT is this? Browser, Java client, etc.? Might make a difference.
My AUT is a Java client and it has popup menus in treeviews. I took the same approach as the previous reply and it works fine. I then extended the TreeView class to add a RightClickOnItem (sItemName) method which does the GetRect and Click commands.
I don't use the coordinate method at all for popups in Java applications, but then maybe my use of popups is a little different than standard. Popups (like flyby text) are dynamically created, mutually exclusive objects - only one can exist at a time. Silk's Record/WindowDeclarations doesn't see them but you can get at them with carefully placed GetChildren() calls.
The solution I found is to manually create a Popup declaration and define all possible instances of popup menus and popup menuitems under that one declaration. You can then use the normal window.Popup.menuitem.Pick() syntax just like any other standard menu.
To obtain the popup menu items, expose the popup manually, then run a short routine that does a listprint of GetChildren(). Initially you'll run this routine against the Mainwin to capture the Popup instance itself, then use that Popup declaration to obtain a ListPrint of its children. Write their equivalent declaration entries as children of the Popup declaration. (Note that you can easily massage this GetChildren list to obtain the class of each menuitem or even actually format the needed declarations directly to the results file.)