Firefox在驱动程序最后一个窗口关闭时崩溃

Han*_*ans 9 java crash firefox selenium geckodriver

我有一个项目,有时使用多个FF窗口,有时使用多个FF驱动程序.在init期间,我创建了一个自定义FirefoxProfile(或从Selenium加载默认值而没有任何更改),将其添加到DesiredCapabilities,向FirefoxOptions添加功能并使用FirefoxOptions启动FF.

测试用例执行正常,直到我需要关闭窗口:

driver.getWindowHandles().forEach(name -> driver.switchTo().window(name).close());
Run Code Online (Sandbox Code Playgroud)

要么

driver.quit();
Run Code Online (Sandbox Code Playgroud)

在其中任何一个传递完成后,FF关闭并出现"Firefox已崩溃"弹出窗口.日志中不会显示任何异常.

在此输入图像描述

如果删除FirefoxProfile,则不会显示崩溃弹出窗口,但需要FirefoxProfile才能启用Flash支持并执行更多操作.

使用:

  • 硒3.4.0
  • Firefox 54(32位)
  • Geckodriver 0.17(32位)
  • Windows 10,64位// Windows 7,64位

Flo*_* B. 6

驱动程序无法正确终止Firefox创建的子进程,如flash.

https://github.com/mozilla/geckodriver/issues/285

要避开对话框,可以将environemnt变量设置XRE_NO_WINDOWS_CRASH_DIALOG为1.