A modal dialog is present (WARNING: the server did not provide any stack information)

I am currently using the Selenium Web driver. (2.24.1) - Programming Language - JAVA

I want to save the web page only in HTML format, so I use the Robot class to save the web page.

I use this Save function in a loop (for n times).

This works well for several cases in the loop, but randomly (maybe the 1st or 3rd time ... nth times), it does not work with the error "Exception in thread" main "org.openqa.selenium. UnhandledAlertException: There is a modal dialog (WARNING: the server did not provide any stack information) "

+4
source share
1 answer

Well, it depends on what the Modal Dialog was, but there are three things that I would check.

First you will most likely need to update your web driver

I noticed that you are using Webdriver 2.2.24 if you are also using FireFox as the browser that you want to upgrade WebDriver to 2.2.26 or higher. The change was made: “Prevent Firefox update, check and warning for extensions and plugins updates”, if any of these things happen, they will also raise a modal dialog.

Second one . It may be a dialogue raised on the site you are testing. javascript alert () or window.Prompt () are examples of modal dialogs that a site raises to do any number of things. You can use WebDriver to interact with these dialogs.

Third . If he didn’t get the screen capture of the Dialog dialog box, the dialog may not be the one you can access through the WebDriver API, so you need to write code to capture the entire screen (it should be easy with some search engines). Or you can record a video session when you run the code.

+2
source

Source: https://habr.com/ru/post/1433726/


All Articles