# Download a file from Chrome in desired location

**URL:** <https://forum.katalon.com/t/download-a-file-from-chrome-in-desired-location/10792>\
**Category:** Web Testing\
**Tags:** chrome\
**Created:** [May 9, 2018, 8:46am UTC](https://forum.katalon.com/t/download-a-file-from-chrome-in-desired-location/10792 "2018-05-09T08:46:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amit\_Kumar](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@Amit\_Kumar](https://forum.katalon.com/u/Amit_Kumar)\
**Post date:** [May 9, 2018, 8:46am UTC](https://forum.katalon.com/t/download-a-file-from-chrome-in-desired-location/10792/1 "2018-05-09T08:46:46Z")

</div>

Need detailed execution settings under Chrome so that I could download a file to a location defined as arguments. Currently, ‘Save as’ dialogue box is opens up. I want to avoid this dialogue box as well. Please suggest with detailed steps asap.

---

<div class="post-metadata">

**Author:** ![Amit\_Kumar](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@Amit\_Kumar](https://forum.katalon.com/u/Amit_Kumar)\
**Post date:** [May 9, 2018, 8:49am UTC](https://forum.katalon.com/t/download-a-file-from-chrome-in-desired-location/10792/2 "2018-05-09T08:49:28Z")

</div>

Basically, want to incorporate below code through Katalon:

System.setProperty(“webdriver.chrome.driver”, “/path/to/chromedriver”);

String downloadFilepath = “/path/to/download”;

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();

HashMap\<String,  
Object\> chromeOptionsMap = new HashMap\<String, Object\>();

options.setExperimentalOptions(“prefs”,  
chromePrefs);

options.addArguments("–test-type");

DesiredCapabilities cap = DesiredCapabilities.chrome();

cap.setCapability(ChromeOptions.CAPABILITY,  
chromeOptionsMap);

cap.setCapability(CapabilityType.ACCEPT\_SSL\_CERTS, true);

cap.setCapability(ChromeOptions.CAPABILITY, options);

WebDriver driver = new ChromeDriver(cap);
