SeleniumLibrary: ff_profile_dir does nothing
I’m trying to use a new Firefox profile so I can control download directory location.
I’ve created Firefox profile and set directory.
In my Robot test I define the ff_profile_dir:
Open Browser
... url=${START_URL}
... browser=${BROWSER}
... ff_profile_dir=C:/Users/mydir/AppData/Local/Mozilla/Firefox/Profiles/robot
Run test - the file is downloaded but not in the correct directory defined in the profile.
Environment
- Windows 10
- geckodriver 0.23.0
- robotframework==3.0.4
- robotframework-seleniumlibrary==3.2.0
- selenium==3.141.0
Firefox Developer Edition 64- Firefox 63.0.3
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 21 (4 by maintainers)
I think I found the issue. I had opened the Selenium profile in firefox browser manually that i was working on. Since that profile was already in use, the same profile coudln’t be opened twice using Selenium and RobotFramework.
IT WORKS! I could have sworn I tried browser.download.folderList = 2 but that may have been before I reinstalled my browsers.
Thank you so much!
Replying to both the comments : @jimpriest
Not exactly, i created a Selenium profile manually using firefox Manager and i use that profile to run automation which is free of all plugins.
And then using the Open Browser Keyword specified above i provide the path of the Selenium profile i created manually.
I tried the same thing in chrome, even that is also not opening the default ff_profile_dir i provide.
Also if i run this chunk of code , it does open the right profile i need
from selenium import webdriver from selenium.webdriver.firefox.options import Options from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
options = Options() options.add_argument(“-profile”) options.add_argument(“C:\Users\userid\AppData\Roaming\Mozilla\Firefox\Default”) firefox_capabilities = DesiredCapabilities.FIREFOX firefox_capabilities[‘marionette’] = True driver = webdriver.Firefox(capabilities=firefox_capabilities, firefox_options=options)
@bjneuhaus
it’s my account name on my machine, not a variable, did not specify the name. I have minimum 2 spaces between the keyword and argument. Profile path exists
I did modify your code and I did get the automatic download working with this code:
And by running this test:
There are two differences in the
create_profilemethod:fp.set_preference("browser.download.folderList", 1)->fp.set_preference("browser.download.folderList", 2)The MIME types are based on this blog post. But because SeleniumLibrary and also Firefox seems to be working correctly, I am closing the issue.