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:

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

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -