ChromeOptions chromeOptions = new ChromeOptions(); chromeOptions.setExperimentalOption("prefs", new HashMap(){ { put("profile.default_content_settings.popups", 0); put("download.default_directory", "/home/selenium/Downloads"); put("download.prompt_for_download", false); put("download.directory_upgrade", true); put("safebrowsing.enabled", false); put("plugins.always_open_pdf_externally", true); put("plugins.plugins_disabled", new ArrayList(){ { add("Chrome PDF Viewer"); } }); } }); WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), chromeOptions); driver.navigate().to("http://example.com/myfile.odt"); options.add_experimental_option("excludeSwitches", ["ignore-certificate-errors", "safebrowsing-disable-download- protection", "safebrowsing-disable-auto-update", "disable-client-side-phishing-detection"]) # options.add_extension('/data/cjpalhdlnbpafiamejdnhcphjbkeiagm.crx') # origin