繁体   English   中英

如何从SWT(带有SWTBot)测试消息对话框/框?

[英]How can I testing the Message Dialog/Box from SWT(with SWTBot)?

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:找不到小部件。”

我可以测试谁?

您无法使用SWTBot测试本机对话框。

参考: SWTBot Wiki

暂无
暂无

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

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