0

I'm using Selenide (Selenium wrapper) + TestNG. The problem that when test is failing, Selenide tries to close all windows (as I understand), but when it happens the modal dialog box is appearing ("confirm quit from page"), and Selenide can't close opened windows...(It is not several IEdrivers in task manager) I tried to accept this modal dialog through many variants, but it was not succesfull.

Give advice, how to handle this modal dialog box and close open windows after failed test?

Igor Vlasuyk
  • 514
  • 2
  • 10
  • 22

2 Answers2

0

try with

DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("ignoreProtectedModeSettings", true); capabilities.setCapability(CapabilityType.UNHANDLED_PROMPT_BEHAVIOUR, UnexpectedAlertBehaviour.IGNORE); WebDriver driver = new InternetExplorerDriver(capabilities);

Flup
  • 35
  • 2
  • 9
  • unfortunately, I'm working with already written test framework, and driver initializing occurs in another place where I can't make changes – Igor Vlasuyk Feb 12 '18 at 11:08
0

The solution was to kill all IE processes in task manager by this command

Runtime.getRuntime().exec("taskkill /F /IM iexplore.exe");
Igor Vlasuyk
  • 514
  • 2
  • 10
  • 22