I am writing a Selenium test on Firefox that deals with an alert. The alert appears for a fraction of a second when the test is run, but when done manually the alert persists. C
The chosen answer worked for me, but it seems that FirefoxDriver(org.openqa.selenium.Capabilities) is deprecated. The working alternative is:
FirefoxOptions firefoxOptions = new FirefoxOptions();
firefoxOptions.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, UnexpectedAlertBehaviour.IGNORE);
driver = new FirefoxDriver(firefoxOptions);