Download files using desired capabilities from Firefox and chrome NOT WORKING in 7.0.5 version

Hi Everyone,

There is one button which contains the pdf file. When i am clicking on it, it is not downloading in Downloads folder rather it is opening in new window. I tried with both Firefox browser and chrome options also.Nothing is working. What i have seen at the run the time when the browser is getting opened from Katalon studio the settings of chrome or firfox for PDF Documents change to open in new window rather than downloading. I have used the below code but it is not WORKING:
For Firefox i set the capabilities in Settings of katalon studio below is the screenshot:
as it is pdf file i used application/Pdf:

For chrome i am using settings:

HashMap<String, Object> chromePrefs = new HashMap<String, Object>()
chromePrefs.put(“download.default_directory”, downloadPath)
chromePrefs.put(“download.prompt_for_download”, false)

    // specify path to ChromeDriver
System.setProperty("webdriver.chrome.driver", projDir + "\\Files\\chromedriver.exe")
ChromeOptions options = new ChromeOptions()
options.setExperimentalOption("prefs", chromePrefs)

    // create web driver
WebDriver driver = new ChromeDriver(options)

    // use your driver instead of default one
DriverFactory.changeWebDriver(driver)

Nothing is working. Please help me guys:

For Chrome you can use this configured
–disable-features=DownloadBubble,DownloadBubbleV2

see image

For Firefox, you should use like this:
browser.helperApps.neverAsk.saveToDisk = /
browser.helperApps.neverAsk.openFile = /
pdfjs.disabled = true (and additional for pdf file)