Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selenium 4 - Unable to set Chrome download.default_directory #9210

Closed
chadnorris opened this issue Feb 24, 2021 · 0 comments
Closed

Selenium 4 - Unable to set Chrome download.default_directory #9210

chadnorris opened this issue Feb 24, 2021 · 0 comments
Assignees
Labels

Comments

@chadnorris
Copy link

💥 Regression Report

This python code is working with Selenium 3.141 but is not in 4.0.0.b1. I see a warning - Expected type 'Union[str, int]', got 'dict[str,str]' instead. The documentation I see on this shows prefs is a dictionary (https://chromedriver.chromium.org/capabilities).

options = webdriver.ChromeOptions()
prefs = {'download.default_directory': 'C:\Temp'}
options.add_experimental_option('prefs', prefs)

Last working Selenium version

Worked up to version: 3.141

Stopped working in version: 4.0.0.b1

To Reproduce

from selenium import webdriver

options = webdriver.ChromeOptions()
prefs = {'download.default_directory': 'C:\Temp'}
options.add_experimental_option('prefs', prefs)
driver = webdriver.Chrome(options=options)
driver.maximize_window()
driver.get("https://www.seleniumhq.org/download/")
laa = driver.find_element_by_link_text("32 bit Windows IE")
laa.click()

Detailed steps to reproduce the behavior:

Expected behavior

Default Download Directory set to specified directory and file is downloaded there. C:\Temp in this example.

Test script reproducing this issue (when applicable)

options = webdriver.ChromeOptions()
prefs = {'download.default_directory': 'C:\Temp'}
options.add_experimental_option('prefs', prefs)

Environment

OS: Windows 10
Browser: Chrome
Browser version: 88.0.4324.190
Browser Driver version: 88.0.4324.96
Language Bindings version: Python 3.9.2
Selenium Grid version (if applicable): N/A

@ghost ghost added the needs-triaging label Feb 24, 2021
@AutomatedTester AutomatedTester self-assigned this Mar 1, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Sep 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants