You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to set a custom download directory using the download.default_directory preference in Selenium, the setting is always overwritten to /home/user/Downloads. I have tried multiple directory paths including:
/tmp/
Project root directory
Subfolders within the project
How can we reproduce the issue?
Environment:
Selenium Version: 4.27.0
Java Version: 17
Operating System: Xubuntu 24
ChromeDriver Version: 131.0.6778.87
Chromium Version: 131.0.6778.87
Map<String, Object> prefs = new HashMap<>();
prefs.put("download.default_directory", downloadFilePath);
prefs.put("download.prompt_for_download", false);
prefs.put("download.directory_upgrade", true);
prefs.put("safebrowsing.enabled", true);
options.setExperimentalOption("prefs", prefs);
Expected Behavior:
The browser should use the specified download.default_directory for file downloads.
Actual Behavior:
The download directory is always set to /home/user/Downloads, ignoring the specified download.default_directory.
Steps to Reproduce:
Create a Selenium project using Java and include the above configuration for ChromeOptions.
Specify a custom download directory (e.g., /tmp/ or a project subfolder).
Run the test and observe the download location.
Additional Information:
Verified that the downloadFilePath variable contains a valid absolute path.
Tested with different paths, but the issue persists.
Other preferences (e.g., safebrowsing.enabled) are applied successfully.
Request:
Please investigate if this is a bug or if there are additional steps required to ensure the download.default_directory setting is applied correctly. Let me know if further details or logs are needed.
@maldanus, thank you for creating this issue. We will troubleshoot it as soon as we can.
Info for maintainers
Triage this issue by using labels.
If information is missing, add a helpful comment and then I-issue-template label.
If the issue is a question, add the I-question label.
If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable G-* label, and it will provide the correct link and auto-close the
issue.
After troubleshooting the issue, please add the R-awaiting answer label.
Hi, @maldanus.
Please follow the issue template, we need more information to reproduce the issue.
Either a complete code snippet and URL/HTML (if more than one file is needed, provide a GitHub repo and instructions to run the code), the specific versions used, or a more detailed description to help us understand the issue.
Note: If you cannot share your code and URL/HTML, any complete code snippet and URL/HTML that reproduces the issue is good enough.
Reply to this issue when all information is provided, thank you.
What happened?
When attempting to set a custom download directory using the download.default_directory preference in Selenium, the setting is always overwritten to /home/user/Downloads. I have tried multiple directory paths including:
/tmp/
Project root directory
Subfolders within the project
How can we reproduce the issue?
Relevant log output
Operating System
Xubuntu 24
Selenium version
Java 4.27.0
What are the browser(s) and version(s) where you see this issue?
ChromeDriver Version: 131
What are the browser driver(s) and version(s) where you see this issue?
ChromeDriver Version: 131.0.6778.87
Are you using Selenium Grid?
No response
The text was updated successfully, but these errors were encountered: