繁体   English   中英

无法使用swtbot在Linux中执行右键单击?

[英]Cant right click be performed in linux using swtbot?

我想使用swtbot右键单击上下文菜单,我正在使用以下代码:

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

上面的代码在Windows中可以正常工作,但是在Linux中,它会引发未找到小部件的错误。 treeitem是项目资源管理器中的项目。 这是完整的代码:

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");

为了获得树,我还直接尝试了bot.tree()方法,但它仅在Windows而不是Linux上有效。
另外,我没有要访问的上下文菜单选项的快捷方式。

这可能是SWTBot中的错误。 您应该报告它: https : //wiki.eclipse.org/SWTBot/Contributing#Report_a_bug_or_suggest_an_enhancement

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM