selenium: [🐛 Bug]: download.default_directory after update Chrome and chromedriver not working
What happened?
After update chrome and chromedriver to version 110 chromedriver_mac_arm64 https://chromedriver.chromium.org/downloads download.default_directory stopped working. Before today’s update everything worked. Please let me know if I need to change anything in the code. The file is downloaded but to the main folder with the application and not to the designated path
chrome_options = Options() prefs = {‘download.default_directory’: ‘./x/x’} chrome_options.add_experimental_option(‘prefs’, prefs) driver = webdriver.Chrome(options=chrome_options)
How can we reproduce the issue?
chrome_options = Options()
prefs = {'download.default_directory': './x/x'}
chrome_options.add_experimental_option('prefs', prefs)
driver = webdriver.Chrome(options=chrome_options)
Relevant log output
The file is downloaded but to the main folder with the application and not to the designated path
Operating System
macOS Monterey 12.0.1
Selenium version
4.4.3
What are the browser(s) and version(s) where you see this issue?
Chrome 110
What are the browser driver(s) and version(s) where you see this issue?
ChromeDriver 110.0.5481.77
Are you using Selenium Grid?
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 41 (5 by maintainers)
Commits related to this issue
- [fix] set headless to 'new' for download see: https://github.com/SeleniumHQ/selenium/issues/11637 — committed to shirasagi/shirasagi by sunny4381 a year ago
- Fix issues with window sizing and new headless mode in Chrome > 109: * Current Chrome version (112) has issue handling window sizing See https://github.com/SeleniumHQ/selenium/issues/11637 ... — committed to yohanchatelain/ppmi-scraper by yohanchatelain a year ago
- Fix issues with window sizing and new headless mode in Chrome > 109: (#70) * Current Chrome version (112) has issue handling window sizing See https://github.com/SeleniumHQ/selenium/issues/116... — committed to LivingPark-MRI/ppmi-scraper by yohanchatelain a year ago
- Fix issues with window sizing and new headless mode in Chrome > 109: (#70) * Current Chrome version (112) has issue handling window sizing See https://github.com/SeleniumHQ/selenium/issues/116... — committed to LivingPark-MRI/ppmi-scraper by yohanchatelain a year ago
- Configura downloads para pasta ./data/ Não consegui fazer com que o Chrome baixasse automaticamente pra esta pasta. Parece ser um bug no driver https://github.com/SeleniumHQ/selenium/issues/11637 — committed to luizftoledo/emendas_scraper by vitorbaptista a year ago
https://www.selenium.dev/blog/2023/headless-is-going-away/
–headless --> download path not working –headless=new -> maximizing not working
That is the exactly the same problem I have.
I had the exact same issue where the following worked in previous ChromeDriver versions but it stopped working in 110.0.5481.77 on Windows 10:
I had to make 2 changes:
This now works:
It’s strange how it worked fine without the trailing slash previously. Thanks to this older post
@Anilkumar-Shrestha there is no
--headless=old. as of right now, it is either--headless=newor--headlessThey fix it. Use --headless=new instead --headless and use the entire path to the folder e.g. /Users/xxx/downloads/folder1
@titusfortner Some Help
With chrome version
113.0.5672.64, issue with download file is working fine withchromeOptions.addArguments("--headless=old").I have chromedriver 111.0.5563.64 on my ubuntu docker image and same as @easytester21, I can confirm that issue is still present
I can confirm headless=new fixes codeception based download tests using anasess/setup-chromedriver
Same problem here , our tests that checks file downloads stopped working (still working fine on 109).
Did not test it fully , but it seems it works fine on 110 when not using headless mode , when using headless mode it always faill since it does not find the downloaded file.