【问题标题】:Selenium 3.2.0 crashes FireFox 52 during driver.quit() @ Win 7 Home Premium & GeckoDriver 0.14.0Selenium 3.2.0 在 driver.quit() @ Win 7 Home Premium 和 GeckoDriver 0.14.0 期间崩溃 FireFox 52
【发布时间】:2017-07-29 02:21:27
【问题描述】:

Win 7 和 FireFox 以德语运行。 Win 7 已安装所有可用更新。 32 位和 64 位 GeckoDriver 相同! (我的 Win 7 是 64 位;我的 FireFox 是 32 位)。这只是我电脑的问题吗?

driver.quit() 在我的 InternetExplorer 上运行没有问题。

package JS_JFrame1;                                       

import org.openqa.selenium.WebDriver;                     
import org.openqa.selenium.firefox.FirefoxDriver;        

public class SeleniumFireFoxMinimal1 {  



public static void main(String[] args) throws InterruptedException {

    System.setProperty("webdriver.gecko.driver", "e:\\geckodriver.exe");

    WebDriver driver = new FirefoxDriver();                 

    driver.get("http://www.toolsqa.com");                    

    Thread.sleep(5000);                                   

    driver.quit();                                        

    }

}

像这样的其他 Selenium 命令运行良好:

element = driver.findElement(By.id("sinp"));              

System.out.println( "Element found!");                   

element.clear();                                                

element.sendKeys("black");                                      

element.submit();                                                       

Eclipse 控制台输出:

1488978842009 addons.manager DEBUG 完成启动序列 1488978842565 Marionette INFO 监听端口 52628 1488978843470 addons.manager DEBUG 启动提供程序: 1488978843470 addons.manager DEBUG 注册 关机拦截器 1488978843471 addons.manager DEBUG Provider完成启动: 1488978843514 addons.manager DEBUG 开始 提供者:PreviousExperimentProvider 1488978843515 addons.manager DEBUG 注册关闭阻止程序 PreviousExperimentProvider 1488978843515 addons.manager DEBUG Provider 完成启动:PreviousExperimentProvider 1488978843519 DeferredSave.extensions.json 调试开始写入 1488978843910 DeferredSave.extensions.json DEBUG 写入成功 1488978843910 addons.xpi-utils DEBUG XPI 数据库已保存,设置 架构版本偏好至 2017 年 3 月 8 日 2:14:06 PM org.openqa.selenium.remote.ProtocolHandshake createSession 信息:检测到的方言:W3C 1488978859017 木偶信息新 将不再接受连接 [Child 6128] ###!!!中止: 因通道错误而中止。:文件 c:/builds/moz2_slave/m-rel-w32-00000000000000000000/build/src/ipc/glue/MessageChannel.cpp, 第 2143 行 2017 年 3 月 8 日下午 2:14:20 org.openqa.selenium.os.UnixProcess 销毁 SCHWERWIEGEND:无法使用 PID 4732 终止进程

FireFox-Crash-Popup 的硬拷贝:

https://www.dropbox.com/s/f3cuklcsgdbqcyx/FireFox_52_CrashPopup.PNG?dl=0

在 GitHub 上报告:

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

【问题讨论】:

  • 你试过 driver.close();

标签: java eclipse selenium firefox geckodriver


【解决方案1】:

我在 Windows 10 上遇到了类似的问题,driver.close() 不起作用并且 driver.quit() 抛出异常。

问题在于最新的 geckodriver(0.14 版),检查这些未解决的问题

【讨论】:

【解决方案2】:

当你说你的 firefox 崩溃时,如果这是浏览器给出的弹出窗口 FireFox has stopped working 然后以下解决方案对我有用。

  1. 转到此链接http://www.guru99.com/use-autoit-selenium.html 了解并下载 Auto IT。基本上,它允许您自动化 Windows GUI。
  2. 您必须使用 AutoIT 创建一个 exe 文件,然后将其添加到您的 selenium 脚本中以关闭弹出窗口。
  3. 阅读以上链接,了解如何下载和打开 AutoIT 脚本创建器。您可以创建自己的脚本或使用以下脚本:

    ControlFocus("Firefox","","DirectUIHWND") ControlFocus("Firefox","","Button2") ControlClick("Firefox","","Button2")

  4. 编译一个 exe 并将其添加到您的项目中。

  5. 最后运行以下脚本,即在使用 driver.quit() 方法之后

    试试 {Runtime.getRuntime().exec(System.getProperty("user.dir") + "//");} 捕捉 (IOException e) { System.out.println("无法关闭火狐弹窗");

希望这会有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-06-18
    • 2018-10-22
    • 2020-06-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-05
    相关资源
    最近更新 更多