1

I want to right click a context menu using swtbot, I am using the following code:

treeitem.setFocus();
treeitem.contextMenu("context_menu_text").click();

The above code works fine in windows, but in Linux it throws a widget not found error. treeitem is the project in Project explorer. Here is the full code:

SWTBotView view_project_explorer = bot.viewByTitle("Project Explorer");
List<Tree> controls = new ChildrenControlFinder(view_project_explorer.getWidget()).findControls(WidgetOfType.widgetOfType(Tree.class));
SWTBotTree tree = new SWTBotTree((Tree) controls.get(0));
SWTBotTreeItem treeitem = tree.getTreeItem("myProject");

To get the tree I have also tried the bot.tree() method directly, still it works only on windows not on Linux.
Also, I don't have a shortcut for the context menu option that I want to access.

Destructor
  • 3,154
  • 7
  • 32
  • 51

1 Answers1

0

That might be a bug in SWTBot. You should report it: https://wiki.eclipse.org/SWTBot/Contributing#Report_a_bug_or_suggest_an_enhancement

Mickael
  • 3,506
  • 1
  • 21
  • 33