docker-selenium icon indicating copy to clipboard operation
docker-selenium copied to clipboard

[🐛 Bug]: Could not get absolute path of downloaded file

Open nilic10 opened this issue 4 months ago • 4 comments

What happened?

Hi all, I'm using docker selenium full grid (router, distributor, sessions, session-queue, events-bus are on the same VM, and docker-nodes are on different VM-s). In my tests, I need to download files, and also in some cases, I need to open downloaded files(mostly HTML) in the same session on container browser (wit driver.get($downloded_file_path)), but I'm not able to get path of downloaded file, because it's downloaded in /tmp folder in some generic folder (/tmp/uuid7913403656254552707a679ff8f-89ad-45c8-827b-16e28cede7ba/download4164586578271991079).

Do you have some workaround for getting path of downloaded file? Maybe to add one more parameter 'path' in response of /session/sessionId/se/files endpoint ?

I have this SE_OPTS in my docker node containers: - SE_OPTS=--enable-managed-downloads true and also downloadsEnabled capability is set on true on WebDriver: - setCapability("se:downloadsEnabled", true);

Command used to start Selenium Grid with Docker (or Kubernetes)

router, distributor, sessions, session-queue, events-bus are started on the same VM using single docker compose file:
docker compose -f docker-compose-full-grid.yml up -d

docker-nodes are run on different VM-s using docker compose:
docker compose -f docker-compose.yml up -d

Relevant log output

-

Operating System

Ubuntu

Docker Selenium version (image tag)

4.34.0

Selenium Grid chart version (chart version)

No response

nilic10 avatar Aug 20 '25 08:08 nilic10

@nilic10, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

github-actions[bot] avatar Aug 20 '25 08:08 github-actions[bot]

From client code, you can get the file from remote web driver - https://www.selenium.dev/documentation/webdriver/drivers/remote_webdriver/#download-a-file However, it should be in the session runtime. Once session is closed, downloaded files tmp also get cleaned up

VietND96 avatar Aug 21 '25 11:08 VietND96

yes, but this download method will download file from container to local MVN machine, right ? I need following:

  • open browser on docker container
  • download file from browser to container /tmp
  • open downloaded file directly from /tmp in the same browser, in the same container, using driver.get("$downloaded_file_path")

nilic10 avatar Aug 21 '25 12:08 nilic10

In this case, is it suitable to use a local download? Don't set setCapability("se:downloadsEnabled", true); in code, let it download to default /home/seluser/Downloads in the container, and you call driver.get with that local path

VietND96 avatar Aug 24 '25 12:08 VietND96