Open GoogleCodeExporter opened 9 years ago
Original comment by barancev
on 23 Apr 2013 at 10:36
Which chromedriver version do you use?
Original comment by barancev
on 13 May 2013 at 10:17
Hi, we are getting the same error.
Versions:
Selenium: 2.29.1.0
ChromeDriver: 2.0.204324.dyu
Original comment by mhereu@gmail.com
on 14 Jun 2013 at 2:45
[deleted comment]
Hello,
I am also trying to set download location for chromedriver. Do we have some
info here?
I am using chromedriver_win_26.0.1383.0 and chromedriver_win32_2.0
Do we have an example for each in JAVA maybe?
Original comment by jevtovic...@gmail.com
on 25 Jun 2013 at 12:45
Getting the same bug from python with pypi package version selenium (2.33.0)
Original comment by andres.riancho@gmail.com
on 8 Aug 2013 at 2:27
Original comment by st...@chromium.org
on 26 Sep 2013 at 10:07
Original comment by kka...@google.com
on 13 Jan 2014 at 6:16
Hello,
These days I upgraded Chrome to version 35 and ChromeDriver to version 2.10,
and I found chromePreference.put("download.default_directory", "[directory]")
(Java) is still broken. Looks like the issue above has been existing for a long
time but no progress so far, could someone help take a look? Thanks!
Original comment by shenxie...@gmail.com
on 12 Jun 2014 at 2:29
Original comment by samu...@chromium.org
on 21 Feb 2015 at 12:18
Unable to reproduce the issue, and "download.default_directory", "[directory]"
works good. please let me know if issue is still existing with latest version
of ChromeDriver(2.15), Chrome(41.xx.xx.xx) And Selenium(2.45)
---- tried with----------------
DesiredCapabilities caps = DesiredCapabilities.chrome();
ChromeOptions options = new ChromeOptions();
Map<String, Object> prefs = new HashMap<String, Object>();
prefs.put("download.default_directory", "/usr/local/path/to/download/directory");
options.setExperimentalOption("prefs", prefs);
caps.setCapability(ChromeOptions.CAPABILITY, options);
WebDriver driver = new ChromeDriver(caps);
driver.get("http://www.seleniumhq.org/download/");
driver.findElement(By.xpath("html/body/div/div[2]/div[2]/p[3]/a")).click();
Original comment by agau...@chromium.org
on 10 Apr 2015 at 10:56
This issue still exists.
Capybara.register_driver:selenium do|app|
profile = Selenium::WebDriver::Chrome::Profile.new
profile['download.prompt_for_download'] = false
profile['download.default_directory'] = download_directory
Capybara::Selenium::Driver.new(app, :browser => :chrome,:profile => profile)
end
Error is
Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.47.1/lib/selenium/webdriver/remote/response.rb:71:in `assert_ok': unknown error: cannot parse capability: chromeOptions (Selenium::WebDriver::Error::UnknownError)
from unknown error: unrecognized chrome option: profile
(Driver info: chromedriver=2.16.333243 (0bfa1d3575fc1044244f21ddb82bf870944ef961),platform=Windows NT 6.1 SP1 x86_64)
I found that the "download.default_directory" should be an absolute and existed path. Can all of you check again ? It worked for me.
Hello! You should remove trailing slash on download.default_directory
path. I don't know why, but it's critical for ChromeDriver.
The issue is still there.
ChromeDriver 2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262)
Mac OS 10.11.6
Faced it when writing my own library for browser automation.
My capabilities were:
{:desiredCapabilities {:loggingPrefs {:browser "ALL"},
:chromeOptions {:prefs {:download.default_directory "/Users/ivan/Desktop",
:download.prompt_for_download false,
:profile.default_content_settings.popups 0}}}}
Any update on this?
Any update on this? I still face the same problem.
Here's the excerpt:
Starting ChromeDriver 73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72) on port 21856 Only local connections are allowed. Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code. Exception in thread "main" org.openqa.selenium.InvalidArgumentException: invalid argument: cannot parse capability: goog:chromeOptions from invalid argument: unrecognized chrome option: download.default_directory (Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT 10.0.16299 x86_64) (WARNING: The server did not provide any stacktrace information)
Options I have set:
ChromeOptions options = new ChromeOptions(); options.addArguments("--start-maximized"); options.setExperimentalOption("profile.default_content_settings.popups", 0); options.setExperimentalOption("download.default_directory", "D:\\Selenium\\download"); options.setExperimentalOption("download.prompt_for_download", false); options.setExperimentalOption("download.directory_upgrade", true); options.setExperimentalOption("safebrowsing.enabled", true); this.driver = new ChromeDriver(options);
hi Guys.. im also encountering this issue. Any updates on this?
I'm also seeing this, there was a bug open in the issue tracker but it looks like it disappeared.
+1
Facing the same issue with latest version of chrome : Version 75.0.3770.100 Any help is appreciated !!
If you are using Windows 10 you must specify an explicit folder path in Windows notation. For example, in java this will be look like "C:\\Selenium\\autotest-project\\downloads"
. Do not forget to use two \
. In such case I have it worked with the latest chrome.
I found that the "download.default_directory" should be an absolute and existed path. Can all of you check again ? It worked for me.
--- is it not possible with relative path in the project... for me able to get working with absolute path , but relative path its failing... Kindly, Check and help us with it Thanx in advance.
hey folks, got the soution by placing.... ' ${user.home} ' for the relative path in the .properties file..
Will work 100%..
ex:- chrome_preferences.download.default_directory=${user.home}//Desktop//appium//src//main//resources//pathToData
hey folks, got the soution by placing.... ' ${user.home} ' for the relative path in the .properties file..
Will work 100%..
ex:- chrome_preferences.download.default_directory=${user.home}//Desktop//appium//src//main//resources//pathToData
you save my day 💃
My selenium helper for chrome browser ---
final ChromeOptions options = new ChromeOptions();
HashMap<String, Object> chromePref = new HashMap<>();
options.addArguments("--incognito", "--disable-popup-blocking", "safebrowsing-disable-
download-protection", "allow-unchecked-dangerous-downloads");
//to provide download location if any
chromePref.put("profile.default_content_settings.popups", 0);
chromePref.put("download.default_directory", DOWNLOAD_LOCATION_PATH);
//chromePref.put("download.extensions_to_open", "EML");
chromePref.put("safebrowsing.enabled", false);
//chromePref.put("useAutomationExtension", false);
chromePref.put("download.prompt_for_download", false);
chromePref.put("download.directory_upgrade", true);
options.setExperimentalOption("prefs", chromePref);
driver = new ChromeDriver(options);
I am still unable to fix the problem of warning message "this file can harm my computer" with keep and discard button. I tried the download path changing from user.dir to user.home, doesn't help.
i have same problem Caused by: org.openqa.selenium.InvalidArgumentException: invalid argument: entry 0 of 'firstMatch' is invalid from invalid argument: cannot parse capability: goog:chromeOptions from invalid argument: unrecognized chrome option: desiredCapabilities.chromeOptions.prefs.download.default_directory Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info:, os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_212' Driver info: driver.version: ChromeDriver remote stacktrace: Backtrace:
i have tried below properties desiredCapabilities.chromeOptions.prefs.download.default_directory chromeOptions.prefs.download.default_directory prefs.download.default_directory download.default_directory
path is also correct
I have the same problem. Try to use all approaches mentioned here. :-(
I've found that chromedriver cannot create the folder if it doesn't exist, and manually adding the folder solved the inability to download.
I've found that chromedriver cannot create the folder if it doesn't exist, and manually adding the folder solved the inability to download.
Yes, I found the mistake. It was the wrong folder. Thank you. Now everything is downloading fine.
In my case , I am not getting any error but the file is downloaded to default download location. I have used existing directory but it just does not work.Chrome version :83 and 77 ( MAC) and 78 (windows) Map<String, Object> prefs = new HashMap<String, Object>();
Method 1 :
File folder = new File(UUID.randomUUID().toString());
folder.mkdir();
prefs.put("download.default_directory", folder.getAbsolutePath());
Method 2:
prefs.put("download.default_directory", System.getProperty("user.dir")+ File.separator + "externalFiles" + File.separator + "downloadFiles");
Method 3:
String path = "/Users/
Common code: ChromeOptions options = new ChromeOptions(); options.setExperimentalOption("prefs", prefs); DesiredCapabilities capabilities = DesiredCapabilities.chrome(); capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); capabilities.setCapability(ChromeOptions.CAPABILITY, options); WebDriver driver = new ChromeDriver(capabilities);
One of the reasons why you can't set your value in to "download.default_directory" may be that you have a system variable XDG_DOWNLOAD_DIR in file ~/.config/user-dirs.dirs because chromedriver, unpredictable, prior that settings.
My SW set:
hi Folks, I'm facing same issue after tried the above changes to my code. I think this issue is still open. If not, please help me out.
Thanks in advance
I am also stuck with that problem. I couldn't proceed. Even I tried above mentioned configuration, I still get an error. Any improvements or suggestions?
My problem is not able to download the file using chrome latest version in windows10 machine And I am using webdriverIO Problem: When I click on download link it just open in a new tab and stays there
Here is my configuration file: browserName: 'chrome', acceptInsecureCerts: true, 'goog:chromeOptions':{ args: [ '--window-size=2600,1800', //'--headless', '--allow-http-background-page', '--allow-running-insecure-content', '--allow-insecure-localhost', '--no-sandbox', '--disable-dev-shm-usage', '--disable-infobars', '--disable-web-security', '--disable-popup-blocking' ], prefs : { 'download.prompt_for_download' : false, 'download.directory_upgrade': true, 'download.default_directory' : pathToDownload, 'profile.managed_default_content_settings.popups': 0, 'profile.managed_default_content_settings.notifications': 1, 'profile.content_settings.exceptions.automatic_downloads.*.setting': 1, 'safebrowsing.enabled': true, } },
Original issue reported on code.google.com by
bobby.bl...@gmail.com
on 23 Apr 2013 at 7:38