I am using a Chrome Driver and trying to test a webpage.
Normally it runs fine, but sometimes I get exceptions:
org.openqa.selenium.UnhandledAlertE
Is your switch to alert within a try/catch block? You may also want to add a wait timeout to see if the alert shows up after a certain delay
try {
// Add a wait timeout before this statement to make
// sure you are not checking for the alert too soon.
Alert alt = driver.switchTo().alert();
alt.accept();
} catch(NoAlertPresentException noe) {
// No alert found on page, proceed with test.
}