Reputation: 121
I am new to selenium and I was working with having to run my test at different browser and versions. After having to run it in Firefox 15, I uninstalled Firefox15 and installed Firefox17, which is when the error stared.
The firefoxdriver was called, but it gives this error:
Failure: OpenQA.Selenium.UnhandledAlertException : Modal dialog present
Build info: version: '2.26.0', revision: '18041', time: '2012-11-01 19:33:38'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_09'
Driver info: driver.version: EventFiringWebDriver
Session ID: e1417203-a392-4f74-948e-2108fb2bbe34
It actually opens the page, but then it refreshes it and then some alerts come out.
I have tried uninstalling it and installing Firefox 15 again but nothing works. Internet Explorer works fine so I know it was not Selenium, but the Firefox driver.
I am using Selenium 2.26.0 and running it by seleniumRC.
Upvotes: 2
Views: 4101
Reputation: 4621
You can try this code to supress the alerts :
DesiredCapabilities dc=new DesiredCapabilities();
dc.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR,UnexpectedAlertBehaviour.ACCEPT);
driver =new FirefoxDriver(dc);
Upvotes: 2