This question is locked. New answers and comments are not allowed.
We are using quite a lot modal dialogs which are closed by javascript window.close() calls. What is the preferred method to deal with this? When recording two steps are recorded when clicking a button that calls window.close():
Unfortunately by the time that ActiveBrowser.Close() is called, the dialog is already close and the call to ActiveBrowser.Close() results in an error: System.OperationCanceledException: Exception occured waiting for the new browser to connect. ---> System.TimeoutException: Wait for condition has timed out
Removing ActiveBrowser.Close() is probably not the solution either elements on the page that initiated the opening of the modal dialog, cannot be located anymore. Probably the manager is under the impression that the dialog still exists and tries to locate elements in that dialog?
- Page.MyPage.Button.Click(true)
- ActiveBrowser.Close()
Unfortunately by the time that ActiveBrowser.Close() is called, the dialog is already close and the call to ActiveBrowser.Close() results in an error: System.OperationCanceledException: Exception occured waiting for the new browser to connect. ---> System.TimeoutException: Wait for condition has timed out
Removing ActiveBrowser.Close() is probably not the solution either elements on the page that initiated the opening of the modal dialog, cannot be located anymore. Probably the manager is under the impression that the dialog still exists and tries to locate elements in that dialog?