Is the message box native SWT? I ask, because SWTBot can't handle native SWT dialogs like message boxes or file dialogs.
Suggestion: work in your application code with (JFace) MessageDialog.openInformation(....) and not nativ SWT dialogs. This works fine with SWTBot.<
我可以使用MessageDialog.openInformation(....)
创建一个MessageDialog,但我会测试单击“是”或“否”时会发生什么。
我试图将MessageDialog中的“是”和“否”按钮解释为按钮。
okButton = bot.button("Yes");
但是我得到了一个“org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException:找不到小部件。”
我可以测试一下吗?