I found that the exception was catching driver.switchTo().alert(); so slow in Firefox (FF V20 and selenium-java-2.32.0).
So, I choose another way:
private static boolean isDialogPresent(WebDriver driver) { try { driver.getTitle(); return false; } catch (UnhandledAlertException e) {
And this is the best way when in most of your test cases there is no NO dialog box (throwing an exception is expensive).
andyf Aug 12 '13 at 8:21 2013-08-12 08:21
source share