code: public String waitForMenuItemPressed(String menuItemText) {
      if (getScopeServices().getConnection() == null) {
        throw new CommunicationException(
            "waiting for a menu item to be pressed failed because Opera is not connected.");
      }
  
      return getScopeServices().waitForMenuItemPressed(menuItemText,
                                                       OperaIntervals.MENU_EVENT_TIMEOUT.getMs());
    }
docs: Waits until the menu item is pressed and then returns the text of the menu item pressed
  
  @param menuItemText - window to wait for shown event on
  @return text of the menu item