簡體   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