Files are not download to the folder set by desired capability setting in Jenkins/Linux

Files are not download to the folder set by desired capability setting in Jenkins/Linux. instead, it goes to default download folder.

Please let us know how would your work be affected if this issue has not been resolved?

I cannot continue my job and have to work on something else while awaiting your response

Operating System

  • For example: Linux/Jenkins

Katalon Studio Version

KSE 7.4.0 and earlier

Katalon Studio logs

  • Windows logs folder: \config.metadata.log

  • macOS logs folder: file:///Applications/Katalon%20Studio.app/Contents/MacOS/config/.metadata/.plugins/org.eclipse.ui.workbench/log

Screenshots / Videos

  • Please attach screenshots or videos if necessary to reproduce the issue

@duyluong any update on this bug?

@gxu
Please share us the Desired Capabilities setting, execution log, and a sample script

@duyluong This is the desired chrome capability settings, note this: “download.default_directory”:“Results/download”
{“CHROME_DRIVER”:{“prefs”:{“browser.download.manager.showWhenStartingbrowser.download.manager.showWhenStarting”:“false”,“download.default_directory”:“Results/download”,“download.directory_upgrade”:true,“download.prompt_for_download”:false,“plugins.always_open_pdf_externally”:true,“profile.default_content_settings.popups”:“0”,“profile.content_settings.exceptions.automatic_downloads.*.setting”:“1”,“property”:true}}}

Here is the execution log with success in Mac with same settings:

Same run fails in Linux VM machine and Jenkins:

This is the execution log in text view:
2020-06-12 14:21:39.597 INFO c.k.k.core.webui.driver.DriverFactory - Starting ‘Chrome’ driver
Jun 12, 2020 2:21:39 PM org.openqa.selenium.remote.DesiredCapabilities chrome
INFO: Using new ChromeOptions() is preferred to DesiredCapabilities.chrome()
2020-06-12 14:21:39.608 INFO c.k.k.c.w.util.WebDriverPropertyUtil - User set preference: [‘prefs’, ‘{browser.download.manager.showWhenStartingbrowser.download.manager.showWhenStarting=false, download.default_directory=Results/download, download.directory_upgrade=true, download.prompt_for_download=false, plugins.always_open_pdf_externally=true, profile.default_content_settings.popups=0, profile.content_settings.exceptions.automatic_downloads.*.setting=1, property=true}’]
2020-06-12 14:21:39.623 INFO c.k.k.core.webui.driver.DriverFactory - Action delay is set to 0 milliseconds
Starting ChromeDriver 81.0.4044.69 (6813546031a4bc83f717a2ef7cd4ac6ec1199132-refs/branch-heads/4044@{#776}) on port 11051
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
[1591971699.753][SEVERE]: bind() failed: Cannot assign requested address (99)
Jun 12, 2020 2:21:42 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
2020-06-12 14:21:42.153 INFO c.k.k.core.webui.driver.DriverFactory - sessionId = 800ef5f9157443c605635b0ac403463a
2020-06-12 14:21:42.165 INFO c.k.k.core.webui.driver.DriverFactory - browser = Chrome 81.0.4044.113
2020-06-12 14:21:42.166 INFO c.k.k.core.webui.driver.DriverFactory - platform = Linux
2020-06-12 14:21:42.166 INFO c.k.k.core.webui.driver.DriverFactory - seleniumVersion = 3.141.59
2020-06-12 14:21:42.166 INFO c.k.k.core.webui.driver.DriverFactory - proxyInformation = ProxyInformation{proxyOption=NO_PROXY, proxyServerType=HTTP, password=, proxyServerAddress=, proxyServerPort=0, executionList=}
[1591971702.633][SEVERE]: Timed out receiving message from renderer: 0.100
[1591971703.109][SEVERE]: Timed out receiving message from renderer: 0.100
[1591971703.464][SEVERE]: Timed out receiving message from renderer: 0.100
[1591971703.565][SEVERE]: Timed out receiving message from renderer: 0.100
2020-06-12 14:21:43.979 INFO k.k.c.m.CustomKeywordDelegatingMetaClass - com.gh.portal.Common.logon is PASSED
2020-06-12 14:21:43.980 DEBUG testcase.New Test Case - 7: com.gh.portal.Common.downloadReport(requestID)
[1591971706.776][SEVERE]: Timed out receiving message from renderer: 0.100
[1591971706.967][SEVERE]: Timed out receiving message from renderer: 0.100


Test Suites/DebugForJenkins - Chrome - 20200612_142134…0/1(0%)

2020-06-12 14:21:55.045 INFO k.k.c.m.CustomKeywordDelegatingMetaClass - com.gh.portal.Common.downloadReport is PASSED
2020-06-12 14:21:55.046 DEBUG testcase.New Test Case - 8: assert TestUtil.waitUntilFileExist(filePath, 60) == true


Test Suites/DebugForJenkins - Chrome - 20200612_142134…0/1(0%)


Test Suites/DebugForJenkins - Chrome - 20200612_142134…0/1(0%)


Test Suites/DebugForJenkins - Chrome - 20200612_142134…0/1(0%)


Test Suites/DebugForJenkins - Chrome - 20200612_142134…0/1(0%)

2020-06-12 14:22:56.066 ERROR c.k.katalon.core.main.TestCaseExecutor - ? Test Cases/AcceptanceTest/New Test Case FAILED.
Reason:
Assertion failed:

assert com.gh.core.TestUtil.waitUntilFileExist(filePath, 60)==true
| | |
false | false
/home/jenkins/agent/workspace/test-automation-jobs/portal-web-automation-test-suite/Results/download/Guardant360-A0245540-v1-Final.pdf

@duyluong any update on this bug? About sample script, you can create any download script in your linux machine, since the same script download fine in mac but not linux, so it’s an issue in linux.

Hi @gxu,

We are able to set Chrome default download directory by desired capabilities.
You can refer to our sample project: https://github.com/duyluonganh/kat-download-file and see the recorded video: https://drive.google.com/drive/folders/1sgjLP8GClLWolK6OGoBHpX_Yd03ZpOWN?usp=sharing

System Infomation:
OS: Ubuntu 18.04 LTS VM
Browser: Chrome 83
Katalon Runtime Engine: 7.5.5

Our suggestions:

  • Rerun the test suite but don’t close the browser at the end.
  • Check the file was downloaded or not?
  • Check the workspace folder is correct or not?
  1. The file is downloaded, it goes into /root/Downloads, not the location desired capability settings specified.
  2. The same desired settings work on Mac.