SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.77k stars 8.2k forks source link

[🐛 Bug]: Cannot Turn Off New Auto Download Feature. #14327

Closed Nutcutt3er closed 3 months ago

Nutcutt3er commented 3 months ago

What happened?

Selenium and Chrome For Testing, how to disable the new browser.driver download?

I have Chrome For Testing and chromedriver installed in a custom location, and everything works, but it downloads the newer version(and does nothing with them everytime I run the script.)

I can watch in task manager as it maxes out my internet for a while downloading.

It is downloading new browser and driver?

How can we reproduce the issue?

service = Service()
options = webdriver.ChromeOptions()
chrome_path = r"testing\chrome-win64\chrome.exe"
options.binary_location = chrome_path
#options.page_load_strategy = 'eager'
#options.add_argument("--headless=new")
options.add_experimental_option('excludeSwitches', ['enable-logging'])
#options.add_experimental_option("detach", True)
options.add_argument("disable-extensions");
options.add_experimental_option("prefs", {
  "download.default_directory": "my\\directory",
  "download.prompt_for_download": False,
  "download.directory_upgrade": True,
  "credentials_enable_service": False,
  "profile.password_manager_enabled": False,
})

Service('testing/driver/chromedriver.exe')
driver = webdriver.Chrome(service=service, options=options)
driver.get('https://www.google.com/')
time.sleep(20)

Relevant log output

Selenium Manager set by env SE_MANAGER_PATH to: C:\******\Scripts\selenium-manager.exe
Selenium Manager binary found at: C:\*******\Scripts\selenium-manager.exe
Executing process: C:******\Scripts\selenium-manager.exe --browser chrome --browser-path testing\chrome-win64\chrome.exe --debug --language-binding python --output json
chromedriver not found in PATH
Running command: wmic datafile where name='C:******\\testing\\chrome-win64\\chrome.exe' get Version /value
Output: ""
Running command: REG QUERY HKCU\Software\Google\Chrome\BLBeacon /v version
Output: ""
chrome not found in the system
Required browser: chrome 126.0.6478.182
chrome 126.0.6478.182 already exists
chrome 126.0.6478.182 is available at C:\******\.cache\selenium\chrome\win64\126.0.6478.182\chrome.exe
Required driver: chromedriver 126.0.6478.182
chromedriver 126.0.6478.182 already in the cache
Driver path: C:******\.cache\selenium\chromedriver\win64\126.0.6478.182\chromedriver.exe

Operating System

Win 10

Selenium version

Python Selenium Version: 4.22.0

What are the browser(s) and version(s) where you see this issue?

Chrome For Testing Version 126.0.6478.182

What are the browser driver(s) and version(s) where you see this issue?

Chromdriver 127.0.6533.88

Are you using Selenium Grid?

No Grid

github-actions[bot] commented 3 months ago

@Nutcutt3er, 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.

Thank you!

diemol commented 3 months ago

You are declaring the service -> service = Service(), and then in the code, you are never modifying that variable.

github-actions[bot] commented 3 months ago

💬 Please ask questions at:

Nutcutt3er commented 3 months ago

This is setting the location correct? Otherwise can you please elaborate?

Service('testing/driver/chromedriver.exe') driver = webdriver.Chrome(service=service, options=options)

diemol commented 3 months ago

Service('testing/driver/chromedriver.exe') this value is not being used, it is not assigned to any variable.

Nutcutt3er commented 3 months ago

Perfect, thank you!

github-actions[bot] commented 2 months ago

This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs.