5

I'm using selenium web driver with chrome to create some test. The test clicks on a button which causes a zip file to be downloaded to the host.

How can I find the file after downloading?

Noam Mansur
  • 352
  • 1
  • 2
  • 10

1 Answers1

4

This file will land in the default download location from Google Chrome unless set explicitly in your code with DesiredCapabilities and ChromeOptions as describe here.

Default location of Downloads folder.

nix systems:

String location = System.getProperty("user.dir") + "/Downloads";

Windows:

String location = System.getProperty("user.dir") + "\\Downloads";
Jitesh Prajapati
  • 2,533
  • 4
  • 29
  • 51
Grzegorz Górkiewicz
  • 4,496
  • 4
  • 22
  • 38
  • The default location is `System.getProperty("user.dir") + "/Downloads"` in *nix systems and `System.getProperty("user.dir") + "\\Downloads"` in Windows. – Grzegorz Górkiewicz Feb 12 '17 at 23:59
  • 2
    In unix-system to have create the path _/home//Downloads_ you should use "user.home" system property: `System.getProperty("user.home") + "/Downloads"` – ndp Sep 05 '18 at 13:31