You have two options.

Option 1 - Set folder absolute path in the browser profile

Open profile settings, locate prefs in Chrome Specific section and set it to

{"download.default_directory": "C:\\ProgramData\\Inflectra\\Rapise\\Temp\\Downloads"}

 

You may change the folder path to whatever you like. Chrome will create the folder if it is missing.

 

Option 2 - Set folder dynamically from a test 

If you prefer to download a file into a subfolder of your test or download location may be different on different machines then use this method.

In User.js file define the following function.

function GetWebDriverNonProfileCapabilities(profile)
{
	var caps = {};

	// set capabilities based on profile name
	if (profile == "Chrome")
	{
		var downloadFolder = Global.GetFullPath('Downloads');
		caps["prefs"] = {"download.default_directory": downloadFolder};
	}
	
	return caps;
}

`downloadFolder` variable contains the path that will be passed to prefs capability.

Read more about GetWebDriverNonProfileCapabilities function.

If Chrome Blocks Insecure Download

If Chrome shows a popup complaining that an insecure download blocked then you may additionally configure the browser profile to fix this. Add these settings to your prefs:

"safebrowsing.enabled": true, "profile.managed_insecure_content_allowed_for_urls":["domain1", "domain2"]

Here domain1 refers to the domain of a source page that contains the download link and domain2 is the destination domain that serves the file.

Full settings will look like:

{"download.default_directory": "C:\\ProgramData\\Inflectra\\Rapise\\Temp\\Downloads", "safebrowsing.enabled": true, "profile.managed_insecure_content_allowed_for_urls":["domain1", "domain2"]}