Permission Denied when load Firefox Extension in WebDriver
Question: I'm creating a python script with selenium webdriver. I need to use an
extension in firefox, but when I test with a little script, the script
produces an error like this:

    
    
    Traceback (most recent call last):
      File "C:\Users\User\Desktop\Bot\Mania.py", line 8, in <module>
        firefoxProfile.add_extension(elem)
      File "C:\Python34\lib\site-packages\selenium\webdriver\firefox\firefox_profile.py", line 93, in add_extension
        self._install_extension(extension)
      File "C:\Python34\lib\site-packages\selenium\webdriver\firefox\firefox_profile.py", line 264, in _install_extension
        with open(os.path.join(tmpdir, name), 'wb') as f:
    PermissionError: [Errno 13] Permission denied: 'C:\\Users\\User\\AppData\\Local\\Temp\\tmpzq3rmztk.firebug-2.0.11-fx.xpi\\content/firebug/'
    [Finished in 0.4s with exit code 1]
    

The sample code is it:

    
    
    from selenium import webdriver
    from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
    import os
    
    firefoxProfile = FirefoxProfile()
    elem = "quickjava-2.0.6-fx.xpi"
    firefoxProfile.add_extension(elem)
    firefoxProfile.set_preference("thatoneguydotnet.QuickJava.startupStatus.CSS", 2)
    driver = webdriver.Firefox(firefoxProfile)
    driver.get('http://www.google.cl')
    

PS: The add-on is in the same folder that the script. I tested with full path
but it doesn't work too.


Answer: You need to provide an absolute path to the extension:

    
    
    firefoxProfile.add_extension("/absolute/path/to/the/extension")
    

