Selenium 3.2.0 crashes FireFox 52 during driver.quit() @ Win 7 Home Premium & GeckoDriver 0.14.0

落爺英雄遲暮 提交于 2019-12-09 05:49:28

I have the similar issue on Windows 10, driver.close() doesn't work and driver.quit() throws exception.

The issue is with the latest geckodriver (version 0.14), check these open issues

When you say your firefox crashes,if this the pop up that the browser gives FireFox has stopped working then the following solution worked for me.

  1. Go to this link http://www.guru99.com/use-autoit-selenium.html to know about and download Auto IT. Basically it allows you to automate windows GUI.
  2. You have to create an exe file using AutoIT which you will add to your selenium script to close the pop up.
  3. Read on the above link how to download and open AutoIT script creator. You can create your own script or use the one below :

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

  4. Compile an exe and add it to your project.

  5. Run the following script in the end i.e. after you use the driver.quit() method

    try {Runtime.getRuntime().exec(System.getProperty("user.dir") + "//");} catch (IOException e) { System.out.println("Unable to close the Firefox pop up");

Hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!