I've read through a bunch of selenium topics on here and I've been going in circles on how the permissions / options should be set for the chromedriver. I've made the following code:
System.setProperty("webdriver.chrome.driver", "/Users/username/chromedriver");
String downloadFilepath = "//User//username//automation-testing//";
HashMap<String, Object> chromePrefs = new HashMap<String, Object>();
chromePrefs.put("profile.default_content_settings.popups", 0);
chromePrefs.put("download.default_directory", downloadFilepath);
ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("prefs", chromePrefs);
options.addArguments("disable-popup-blocking");
DesiredCapabilities cap = DesiredCapabilities.chrome();
cap.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
cap.setCapability(ChromeOptions.CAPABILITY, options);
WebDriver driver = new ChromeDriver(cap);
The call to the download page is made using a simple
driver.get(url);
which redirects to a csv file.
I keep getting a popup prompt asking me if downloading files is okay. It's worth mentioning that the new ChromeDriver(cap) line is deprecated, but I can't seem to find documentation on how to use the method that replaced it that covers this use case.
Solution that I used was pretty intense full source below to log into jira via google below, then download a filter view to csv (current selection) below: