New issue 195 by daniel.g...@gmail.com: Create separate keywords for
selecting from popup menus
http://code.google.com/p/robotframework-swinglibrary/issues/detail?id=195
In our test framework we need to be able to save a right click in a
component separately from selecting a item from the popup menu. The current
implementation of selectFromPopupMenu, and it related keywords, does both
at once. We have done a workaround by using jemmy and swinglibrary APIs
directly but it should be nice to have swinglibry supporting this feature.
Comment #1 on issue 195 by pekka.klarck: Create separate keywords for
selecting from popup menus
http://code.google.com/p/robotframework-swinglibrary/issues/detail?id=195
If you have already implemented this, could you provide a patch? We have
just started a small iteration developing SwingLibrary further and new
keywords can easily be added. A patch with tests and docs would definitely
be accepted but just seeing the code would help a lot.
Btw, would switching SwingLibrary from Subversion to Mercurial help
contributing code?
We have already implemented this, but in Python in our own code (PyUseCase)
so it's not really a patch yet. We're also still implementing our own
support for popups, but I'm sure we can provide a patch for this eventually.
As for Mercurial, I think it's fair to say we aren't it's biggest fans :)
but open source development is usually easier with some distributed system,
yes. If you have more choices, I'd recommend Bazaar which we use, it's more
flexible than Mercurial in how you work and handles directory structures
and changes to them in a better way.
It is very simple for us to implement this because we already have
instances of the component to be right clicked and the menu item to be
selected, see the code below. I think you can get the component instance in
the same way as you do in clickOnComponent keyword. The menu item instance
could be more difficult to obtain. You have to assume that the popup is
showing and then try to find the menu item on it.
===============================================================
from org.netbeans import jemmy
def activatePopup(self, component):
operator = jemmy.operators.ComponentOperator(component)
operator.clickForPopup()
def selectFromPopupMenu(self, menuItem):
operator = jemmy.operators.JMenuItemOperator(menuItem)
operator.push()
Hi,
What is the status of this keyword enhancement.
I want to "Right Click" on a button and it popup menu items.
I am using SwingLibrary-1.2
SwingLibrary has Click on Component Keyword but it only allows double click
and single click but no "Right Click"