2

enter image description here

i am using selenium 3 to interact with Firefox 50.1.0

while i am running driver.quit() Firefox gives error while closing the browser

driver.close() is not working at all

is this a version issue ? if yes which version should i install in 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()
jmunsch
  • 22,771
  • 11
  • 93
  • 114
GAURAV CHHABRA
  • 87
  • 2
  • 2
  • 9

3 Answers3

0

Try to downgrade firefox:

Try using a different driver, 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

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. See:

Related:

Community
  • 1
  • 1
jmunsch
  • 22,771
  • 11
  • 93
  • 114
  • alright downgrading firefox is not a solution i tried with two versions 48 and 49, finally i was able to do it with chrome – GAURAV CHHABRA Dec 22 '16 at 11:47
  • possibly `selenium==2.53.6` and `firefox==46.x` but chrome works :) – jmunsch Dec 22 '16 at 11:48
  • thanks alot for your time and all the suggestions, yes finally it worked with chrome cheers – GAURAV CHHABRA Dec 22 '16 at 11:50
  • chromedriver = 'C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe' os.environ["webdriver.chrome.driver"] = chromedriver #driver = webdriver.Chrome('C:\Program Files (x86)\Google\Chrome\Application\chrome.exe') driver = webdriver.Chrome(chromedriver) driver.get('https://my.maerskline.com/webuser/login') – GAURAV CHHABRA Dec 22 '16 at 11:51
0

This is error happens at windows server 2012 and windows 8. It is already reported here. Downgrading to firefox 48.0.2 should fix it

mosaad
  • 2,276
  • 5
  • 27
  • 49
0

I had this issue with Selenium 3.5 and firefox 54, when setting my own FirefoxProfile instance, for example:

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. 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)

Nir
  • 1,836
  • 23
  • 26