How to set a specific download location in Mozilla - Marionette web driver?
<p>I am having an automation script which worked well before the recent mozilla update. The selenium-python script automates some of my browser actions, and save certain reports (csv) to a defined location.</p>

<p>I have been using selenium 2.53.6, which uses the following code :</p>

<pre><code>profile = webdriver.firefox.firefox_profile.FirefoxProfile()
profile.set_preference('browser.helperApps.neverAsk.saveToDisk',"text/csv, application/pdf,application/octet-stream")
profile.set_preference('browser.download.folderList',2)
profile.set_preference("browser.download.manager.showWhenStarting",False)
profile.set_preference('browser.download.dir','D:\Downloads')
driver = webdriver.Firefox(firefox_profile=profile)
</code></pre>

<p>Currently I use selenium-python 3.0.1 and Firefox 48. Here I had added the geckodriver path to environment variables and was able to launch firefox using the code below:</p>

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

caps = DesiredCapabilities.FIREFOX
caps["marionette"] = True
driver = webdriver.Firefox(capabilities=caps)
</code></pre>

<p>I am curious on how to do a <code>profile.set_preference</code> equivalent in firefox-marionette driver. I couldn't find any documentations on it.</p>

<p>Please advise.</p>

<p>You can pass <code>profile</code> as well to launch <a href="http://selenium-python.readthedocs.io/api.html#selenium.webdriver.firefox.webdriver.WebDriver" rel="nofollow"><code>FirefoxDriver</code></a> as :-</p>

<pre><code>driver = webdriver.Firefox(capabilities=caps, firefox_profile=profile)
</code></pre>

<p>You can also set <code>firefox_profile</code> into <code>capabilities</code> as :-</p>

<pre><code>caps["firefox_profile"] = profile
driver = webdriver.Firefox(capabilities=caps)
</code></pre>

python selenium firefox firefox-marionette