*/
public SWTBotViewMenu menu(String label, int index) throws WidgetNotFoundException {
try {
List<SWTBotViewMenu> menuItems = menuFinder.findMenus((IViewReference) partReference, withMnemonic(label), true);
if ((menuItems == null) || (menuItems.size() < 1)) {
CommandFinder finder = new CommandFinder();
List<SWTBotCommand> command = finder.findCommand(equalTo(label));
return command.get(index);
}
return menuItems.get(index);
} catch (Exception e) {
throw new WidgetNotFoundException("Could not find view menu with label " + label + " at index " + index, e); //$NON-NLS-1$ //$NON-NLS-2$