java - Customize Chrome webdriver using selenium to save files without prompting to save or discard files when downloading -
i trying automate downloading files using selenium chrome browser using chromedriver. when try downloading exe files prompting me "this type of file can harm computer, discard or save it". want download anyway without prompt.
i have looked few solutions below:
chromeoptions = webdriver.chromeoptions() prefs = {"browser.helperapps.alwaysask.force" :false,"browser.helperapps.neverask.savetodisk" : "application/octet-stream"} chromeoptions.add_experimental_option("prefs",prefs) browser = webdriver.chrome(executable_path=//path//to//chrome_driver, chrome_options=chromeoptions)
but didn't still throws prompt. on appreciated.
thanks,
from understand, there no way tell chrome
not warn on potentially dangerous binary file downloads, see:
- chromedriver has no way accept dangerous downloads (archived)
- add option automatically accept dangerous downloads (wontfix)
as simplest workaround, might want approach problem firefox:
also there have been numerous requests dev community allow disable warning able run automated tests in chrome. @ moment reason we're running our automated tests in firefox only. annoying.
Comments
Post a Comment