简体   繁体   English

硒3.0.2中的driver.quit firefox 50.1.0 firefox已停止工作

[英]driver.quit in selenium 3.0.2 firefox 50.1.0 firefox has stopped working

在此处输入图片说明

i am using selenium 3 to interact with Firefox 50.1.0 我正在使用硒3与Firefox 50.1.0进行交互

while i am running driver.quit() Firefox gives error while closing the browser 当我运行driver.quit() Firefox在关闭浏览器时出错

driver.close() is not working at all driver.close()根本不起作用

is this a version issue ? 这是版本问题吗? if yes which version should i install in Firefox 如果是,我应该在Firefox中安装哪个版本

from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
binary = FirefoxBinary('C:\Program Files (x86)\Mozilla Firefox\Firefox.exe')
driver = webdriver.Firefox(firefox_binary=binary)
driver.quit()

Try to downgrade firefox: 尝试降级Firefox:

Try using a different driver, chrome, edge, IE, opera. 尝试使用其他驱动程序,chrome,edge,IE,opera。

Basically, try downgrading selenium along with the drivers until you find a version that works possibly selenium==2.53.6 and firefox==46.x 基本上,尝试将selenium与驱动程序一起降级,直到找到可能有效的版本selenium==2.53.6firefox==46.x

Once you find a version that works, be extra sure to save a profile that has autoupdate turned off, and then use it, or just turn it off everytime: 找到可用的版本后,请务必确保保存了已关闭自动更新的配置文件,然后使用它,或者每次都将其关闭:

from selenium import webdriver

profile = webdriver.FirefoxProfile()
profile.set_preference('app.update.auto', False)
profile.set_preference('app.update.enabled', False)
profile.set_preference('app.update.silent', False)
downgraded_firefox = 'C:\Program Files (x86)\Mozilla Firefox\Firefox.exe'
binary = webdriver.FirefoxBinary(downgraded_firefox)
driver = webdriver.Firefox(profile, firefox_binary=binary)

See example of profiles: 查看配置文件示例:

If you click on View problem details of the popup, you might find similar information on why firefox crashed. 如果单击“ View problem details弹出窗口的View problem details ,则可能会找到有关firefox崩溃原因的类似信息。 See: 看到:

Related: 有关:

This is error happens at windows server 2012 and windows 8. It is already reported here . 这是Windows Server 2012和Windows 8上发生的错误。已在此处报告。 Downgrading to firefox 48.0.2 should fix it 降级到Firefox 48.0.2应该修复它

I had this issue with Selenium 3.5 and firefox 54, when setting my own FirefoxProfile instance, for example: 设置自己的FirefoxProfile实例时,Selenium 3.5和firefox 54出现了这个问题,例如:

var firefoxOptions = new FirefoxOptions() { Profile = new FirefoxProfile() };

This looks like a bug in Gecko / Firefox / Selenium, the workaround was setting "browser.tabs.remote.autostart.2 = false" in the firefox profile preferences. 这看起来像是Gecko / Firefox / Selenium中的错误,解决方法是在firefox配置文件首选项中设置“ browser.tabs.remote.autostart.2 = false”。 For example: 例如:

var firefoxService = FirefoxDriverService.CreateDefaultService();

var firefoxProfile = new FirefoxProfile();
firefoxProfile.SetPreference("browser.tabs.remote.autostart.2", false);

var firefoxOptions = new FirefoxOptions() { Profile = firefoxProfile };

using (var webDriver = new FirefoxDriver(firefoxService, firefoxOptions, TimeSpan.FromMinutes(1)))
{
    webDriver.Navigate().GoToUrl("http://www.google.com");
}

(Saw this at https://github.com/SeleniumHQ/selenium/issues/2701 ) (在https://github.com/SeleniumHQ/selenium/issues/2701上看到了)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如果设置了firefox_profile,则python selenium driver.quit()无法退出firefox浏览器 - python selenium driver.quit() can not quit firefox browser if firefox_profile setted Selenium ChromeDriver-driver.quit()上的HTTP 407 - Selenium ChromeDriver - HTTP 407 on driver.quit() 在 driver.quit 后调用 chromedriver 不起作用? - Invoking chromedriver after driver.quit not working? python selenium driver.quit() 里面除了块 - python selenium driver.quit() inside except block python selenium driver.quit() 不会中途终止程序 - python selenium driver.quit() won't terminate the program midway selenium firefox驱动程序python - selenium firefox driver python Selenium 中的 driver.quit():ConnectionRefusedError 如果用于多个驱动程序 object - driver.quit() in Selenium : ConnectionRefusedError if used on more than one driver object 尽管 driver.close 和 driver.quit,IDLE 不会终止我的 selenium 浏览器 - IDLE doesn't terminate my selenium broswer despite driver.close and driver.quit Selenium:如何在不调用 driver.quit() 的情况下停止影响 PC 内存的 geckodriver 进程? - Selenium : How to stop geckodriver process impacting PC memory, without calling driver.quit()? driver.quit() 在未处理的异常之后 - driver.quit() after unhandled exception
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM