Closed pranesh517 closed 4 days ago
[!IMPORTANT] This issue tracker tracks bugs with the Chrome for Testing availability dashboard and its API.
- Are you reporting a bug that reproduces in Chrome for Testing but not in Chrome? File it here: https://goo.gle/cftbug
- Are you reporting a bug in Chrome? File it here: https://crbug.com/new
I am trying to automate a scenario where PDF file will be opened when clicked on a link. I am trying to download this PDF and do some validations. With below code i am not able to download the PDF at said location. Code snippet:
System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir") + "/src/main/resources/browserDriver/chromedriver.exe"); ChromeOptions chromeOptions = new ChromeOptions(); chromeOptions.setBinary( System.getProperty("user.dir") + "/src/main/resources/browserDriver/chrome-win64/chrome.exe"); chromeOptions.addArguments("--allow-running-insecure-content"); chromeOptions.addArguments("--incognito"); chromeOptions.setAcceptInsecureCerts(true); chromeOptions.addArguments("disable-popup-blocking"); HashMap<String, Object> chromePrefs = new HashMap<>(); chromePrefs.put("plugins.always_open_pdf_externally", true); chromePrefs.put("download.default_directory", System.getProperty("user.dir")+"/src/main/resources/downloads"); chromePrefs.put("download.prompt_for_download", false); chromePrefs.put("download.directory_upgrade", true); chromePrefs.put("safebrowsing.enabled", true); chromeOptions.setExperimentalOption("prefs", chromePrefs); driver = new ChromeDriver(chromeOptions);
In above code snippet i am setting path to download the file.
Selenium version: 4.22.0 Chrome for testing - 126.0.6478.126 OS - Windows 11