I am currently writing SWTBot tests and I encountered the problem that at one point I need to wait until an operation is finished and an Info-MessageBox informs me about the completion.
This is how I currently try to do it:
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();
}
This is the message box I am waiting for:
But I get the following exception as SWTBot fails to recognize the message box:
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)
Anyone with a solution for my problem? Thanks!