0

Is there a way to set the path for download that will work for different systems? I'm running tests manually and my download path is C:\Users\myUser\Download.

For my colleague the middle folder will be different. Tests runs with Bamboo on Linux server and path there is different.

Is there a way to set one path that will work everywhere, or a way to check the actual download path and look there?

Can I remove files after download? I can't manipulate with driver, or chrome options - blocked by framework in company.

PiTu
  • 11
  • 1

1 Answers1

0

The below link should provide you the answer you need :) how to change file download location in Webdriver while using chrome driver/firefox driver

Summary: In essence you need to add it as a preference in your ChromeOptions

String downloadFilepath = "/path/to/download/directory/";
Map<String, Object> preferences = new Hashtable<String, Object>();
preferences.put("profile.default_content_settings.popups", 0);
preferences.put("download.prompt_for_download", "false");
preferences.put("download.default_directory", downloadFilepath);

ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("prefs", preferences);
xX13ENXx
  • 1
  • 3