Selenium can't open Firefox 48.0.1
<p>I am starting to learn how to become a better test driven developer when creating web applications in Django. I am trying to use Selenium to open a browser, but I am getting an error.</p>

<pre><code>selenium.common.exceptions.WebDriverException: Message: Can't load the profile. Profile Dir: /var/folders/xn/bvyw0fm97j1_flsyggj0xn9r0000gp/T/tmptoxt890d If you specified a log_file in the FirefoxBinary constructor, check it for details.
</code></pre>

<p>I read that by "Installing the FF extension "Disable Add-on Compatibility Checks" skips this and everything is fine." <a href="http://stackoverflow.com/questions/35868135/selenium-common-exceptions-webdriverexception-message-cant-load-the-profile">selenium.common.exceptions.WebDriverException: Message: Can&#39;t load the profile</a>. I did this, but It is still not working. I used Python2.7 and Python3.5 with Selenium version 2.53.6. </p>

<p>Python file</p>

<pre><code>from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
import unittest

caps = DesiredCapabilities.FIREFOX
caps["marionette"] = True

class NewVisitorTest(unittest.TestCase):  

    def setUp(self):  
        self.browser = webdriver.Firefox(capabilities=caps)

    def tearDown(self):  
        self.browser.quit()

    def test_can_start_a_list_and_retrieve_it_later(self):  
        self.browser.get('http://localhost:8000')

        self.assertIn('To-Do', self.browser.title)  

if __name__ == '__main__':  
    unittest.main(warnings='ignore') 
</code></pre>

<p>Stack Trace</p>

<pre><code>Creating test database for alias 'default'...
EException ignored in: &lt;bound method Service.__del__ of &lt;selenium.webdriver.firefox.service.Service object at 0x103f652b0&gt;&gt;
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 151, in __del__
    self.stop()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 123, in stop
    if self.process is None:
AttributeError: 'Service' object has no attribute 'process'

======================================================================
ERROR: test_can_start_a_list_and_retrieve_it_later (functional_tests.NewVisitorTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/timothybaney/Treehouse/TDD/superlists/functional_tests.py", line 13, in setUp
    self.browser = webdriver.Firefox(capabilities=caps)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/selenium/webdriver/firefox/webdriver.py", line 82, in __init__
    self.service.start()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 62, in start
    stdout=self.log_file, stderr=self.log_file)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 947, in __init__
    restore_signals, start_new_session)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg)
NotADirectoryError: [Errno 20] Not a directory

----------------------------------------------------------------------
Ran 1 test in 0.012s

FAILED (errors=1)
Destroying test database for alias 'default'...
</code></pre>

<p>That error is because you are using FF 48. For FF>=47 FirefoxDriver stop working. You must use the new <a href="https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver" rel="nofollow">MarionetteDriver</a> </p>

<p>Set up this:</p>

<pre><code>from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

caps = DesiredCapabilities.FIREFOX
caps["marionette"] = True

browser = webdriver.Firefox(capabilities=caps)
browser.get('http://localhost:8000')

assert 'Django' in browser.title
</code></pre>

python selenium firefox