I am trying to use python and selenium to automate some tasks in firefox. When I download a file, that pop up comes up asking if you want to open or save, and a check box fo
I did the following:
Or:
Linux: ls -d /home/$USER/.mozilla/firefox/*.default/
to see user profile directories
Mac: ls -d ~/Library/Application\ Support/Firefox/Profiles/*
Output:
/home/jmunsch/.mozilla/firefox/xfoyzfsb.default/
/home/jmunsch/.mozilla/firefox/yxjwk1py.default/
To load a custom user profile I ran through creating a profile in firefox and then did the following with the python selenium webdriver code:
def setUp(self):
self.profile = webdriver.FirefoxProfile('/home/jmunsch/.mozilla/firefox/yxjwk1py.default')
self.driver = webdriver.Firefox(self.profile)
System Info:
Python 2.7.3 (default, Sep 26 2013, 20:08:41)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pkg_resources;pkg_resources.get_distribution("selenium").version
jmunsch@NE-522:~/Desktop/work$ firefox --version
Mozilla Firefox 26.0
@Corey's answer to manually set a profile
All of the configurables can be found under about:config
:
profile.set_preference('browser.download.folderList', 2)