Noam Mansur
Noam Mansur

Reputation: 362

Finding downloaded files with Selenium webdriver

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?

Upvotes: 6

Views: 12506

Answers (1)

Grzegorz Górkiewicz
Grzegorz Górkiewicz

Reputation: 4586

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";

Upvotes: 4

Related Questions