I'm using the code from this question. For some reason any time my test hits anything with an alert it will not return. It hits this:
webDriver.switchTo().alert();
and then just spins forever, never returning. I expect the no alert present exception, but nothing happens.
I've also tried this with no success. As soon as it hits the
wait.until(ExpectedConditions.alertIsPresent());
it spins forever. I have noticed that if I close the browser manually it will skip past it without throwing an exception. I'm using Ubuntu 14, latest version of Chrome, latest version of Webdriver and Chrome driver. My IDE is IntelliJ IDEA.
I've looked for quite a while with little success. Can anyone tell me how to fix my problem?
(UPDATE)
I've played around with this quite a bit and I've noticed something strange. In my test if I use alert functions in the main body of code it works just fine. However, if I make a call from the main body of code to another function, and then in the function make a call to the alert functions, it will never return from the call. Not sure if that helps but I have no idea why that would matter.