Java SWTBot-等待消息框

Java SWTBot-等待消息框,java,shell,swt,messagebox,swtbot,Java,Shell,Swt,Messagebox,Swtbot,我目前正在编写SWTBot测试,我遇到了一个问题,在某一点上,我需要等待操作完成,并且一个信息消息框会通知我操作完成 这就是我目前尝试的方式: public void generateCode() { SWTBotTree projectExplorerTree = bot.viewByTitle("Project Explorer").bot().tree(); projectExplorerTree.getTreeItem(name).contextMenu("

我目前正在编写SWTBot测试,我遇到了一个问题,在某一点上,我需要等待操作完成,并且一个信息消息框会通知我操作完成

这就是我目前尝试的方式:

   public void generateCode() {
      SWTBotTree projectExplorerTree = bot.viewByTitle("Project Explorer").bot().tree();
      projectExplorerTree.getTreeItem(name).contextMenu("Generate Code").click();

      bot.waitUntil(Conditions.shellIsActive("Info"), 20000);
      bot.button(IDialogConstants.OK_LABEL).click();
   }
这是我正在等待的消息框:

但由于SWTBot无法识别消息框,我得到以下异常:

org.eclipse.swtbot.swt.finder.widgets.TimeoutException: Timeout after: 20000 ms.: The shell 'Info' did not activate
    at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(SWTBotFactory.java:412)
    at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(SWTBotFactory.java:386)

有人能解决我的问题吗?谢谢

好的,由于某种原因,消息框是由本机代码创建的,这就是SWTBot找不到它的原因

那么你对此做了什么呢?我不知道确切的解决方案-我只是测试人员,开发软件本身不是我的事。我告诉一个开发人员我有这个问题,我怀疑消息框是一个本地小部件。他构建了一个解决方案,在运行SWTBot测试时,会显示一个虚拟SWT消息框。我不知道该怎么做,但这是一个可行的解决方案。