[英]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.6
和firefox==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: 有关:
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.