I am writing a test script using spock, geb, and WebDriver. The script submits a form on an insecure page. The page submits to a secure HTTPS URL. Firefox shows a warning for this, specifcally:
This causes the following error:
org.openqa.selenium.UnhandledAlertException: Modal dialog present
Build info: version: '2.23.0', revision: '17137', time: '2012-06-07 09:08:12'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.7.4', java.version: '1.6.0_33'
Driver info: driver.version: RemoteWebDriver
Session ID: 79e0444f-4c8e-2b4c-9066-601e7cdb3aa9
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:188)
at org.openqa.selenium.remote.ErrorHandler.createUnhandledAlertException(ErrorHandler.java:169)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:141)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:458)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:462)
at org.openqa.selenium.remote.RemoteWebDriver.getTitle(RemoteWebDriver.java:204)
at geb.Page.getTitle(Page.groovy:200)
at groovy.lang.Closure.getPropertyTryThese(Closure.java:197)
at groovy.lang.Closure.getPropertyDelegateFirst(Closure.java:187)
at groovy.lang.Closure.getProperty(Closure.java:172)
How do I have WebDriver dismiss this alert if it shows up?