Skip to content

Commit

Permalink
try...catch in wait condition
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoBettini committed Nov 23, 2022
1 parent 738ba90 commit f598a6b
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.forms.finder.SWTFormsBot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
import org.junit.BeforeClass;
Expand All @@ -38,7 +39,12 @@ public void testExampleMail() {
@Override
public boolean test() throws Exception {
System.out.println("*** expanding mail tree...");
bot.tree().getTreeItem("lorenzo@foobar").expand().getNode("Inbox").select();
try {
bot.tree().getTreeItem("lorenzo@foobar").expand().getNode("Inbox").select();
} catch (WidgetNotFoundException e) {
System.out.println("### " + e.getMessage());
return false;
}
return true;
}
@Override
Expand Down

0 comments on commit f598a6b

Please sign in to comment.