Reputation: 39
I currently using Selenium Web driver.(2.24.1)- Programming Language--JAVA
I want to save a web Page in HTML only Format, so i am using Robot class to save webpage.
I am using this Save functionality in a loop (for n times).
This is working good for for few cases in the loop but randomly( may be 1st time or 3rd times...nth times) it fails with an error message "Exception in thread "main" org.openqa.selenium.UnhandledAlertException: Modal dialog present (WARNING: The server did not provide any stacktrace information)"
Upvotes: 4
Views: 1055
Reputation: 3215
Well it depends on what the Modal Dialog was, but there are three things I would check.
First Most likely you'll need to upgrade your Web Driver
I noticed you're using Webdriver 2.2.24, if you're also using FireFox as the browser you'll want to upgrade your WebDriver to 2.2.26 or higher. There was a change to "Prevent firefox from updating, checking and warning for extension and plugin updates" IF any of those things occur they also will raise a modal dialog.
Second It could be a dialog raised by the site you're testing
javascript alert() or a window.Prompt() are examples of modal dialogs the site be raising to do any number of things. You can use the WebDriver to interact with these dialogs.
Third If it's none of the above get a screen capture of the dialog The dialog may not be something that you can access through the WebDriver API so you need to write code to get capture the entire screen (should be easy with some googling). Or you can record a video session when running the code.
Upvotes: 2