kyrenia
kyrenia

Reputation: 5575

Can't install certain firefox extensions using Selenium

When I attempt to install Firefox extensions using Selenium on Python, I receive a IOError: [Errno 13] Permission denied error for about 50% of the extensions that i attempt to install. For example, when I try to install the latest version of firebug, with the command:

 firefox_profile.add_extension(working_director + "\\firebug-2.0.11-fx.xpi")

I get the error:

 File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\firefox_profile.py", line 265, in _install_extension
with open(os.path.join(tmpdir, name), 'wb') as f:
 IOError: [Errno 13] Permission denied: 'c:\\users\\USERNAME\\appdata\\local\\temp\\tmpxu73xr.firebug-2.0.11-fx.xpi\\content/firebug/'

(n.b. this does not happen with version 2.0.9 of firebug, which works fine)

I get similar errors when trying to install quickjava (quickjava-2.0.6-fx), and imageblock (imageblock-2.1-fx). I suspect the error originates in the / which is at the end of the install path (as opposed to \\ elsewhere) i.e. ...temp\\tmpxu73xr.firebug-2.0.11-fx.xpi\\content/firebug/.

Can't understand why i don't have problems with some extensions. Looking for a work-around for those which don't work. For reference, I am using Firefox 39, and Selenium 2.46.0 on Windows

Upvotes: 1

Views: 631

Answers (1)

kyrenia
kyrenia

Reputation: 5575

With thanks to @sandwich Heat who initially posted part of the answer (before he/she or someone else deleted it) - this was a bug with Salenium - https://github.com/SeleniumHQ/selenium/issues/734

This issue is fixed on the the github page https://github.com/SeleniumHQ/selenium/blob/master/py/selenium/webdriver/firefox/firefox_profile.py but as of yet is not in the stable release of Selenium (2.46.0)

I thus solved my problem by replacing the file firefox_profile.py with that on Github.

Upvotes: 3

Related Questions