Search code examples
pythonseleniumselenium-webdriverselenium-firefoxdriverfirefox-quantum

Driver error in Firefox Quantum with Selenium and XUL


Version:

  • Ubuntu 16.04
  • Mozilla Firefox 58.0
  • Selenium-3.7.0

Example code:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
from selenium import webdriver

profile = webdriver.FirefoxProfile()
profile.set_preference("browser.privatebrowsing.autostart", True)
driver = webdriver.Firefox(profile)

Error in Firefox with Python-Selenium:

XML read error: entity not defined
Location: chrome://browser/content/browser.xul
Line number 1165, column 7:
      <menuitem class="pageActionContextMenuItem extensionUnpinned"
------^

Note: The error also appears if you use FIrefox Quantum in Ubuntu 12.


Solution

  • Explanation: Is selenium IDE an XUL add-on in Firefox?

    Solution, use a old version to 58 of Firefox:

    sudo apt-get remove --purge firefox
    sudo add-apt-repository ppa:ubuntu-mozilla-daily/firefox-aurora
    sudo apt-get update
    sudo apt-get install firefox=57.0+build4-0ubuntu0.16.04.5
    

    Thanks to @DebanjanB