IsAlertDialogPresent in Unit Tests is not working in special cases


In one special case inside the unit tests, the IsAlertDialogPresent stopped working correctly.

"iwebDriver.switchTo().Alert()" throws an "UnhandledAlertException" instead of returning an alert. It cannot be reproduced in a naked Selenium Test. Also, it only happens in one of three testcases which call this method.


Marcel Holle
September 10, 2019, 11:02 AM

I found out that it got fixed with the Chromedriver version upgrade from v2.38 to v2.41. Could not find related informations in the release notes.

Release notes:

Marcel Holle
September 10, 2019, 10:50 AM

I found the following changes made in Chromedriver v2.44:

But I did not see an apparent relation to our workaround (could not find related issues in UnhandledAlertException issues either).

Will do a quick test with past chromedriver versions.

Your pinned fields
Click on the next to a field label to start pinning.


Marcel Holle


Florian Decker