1

I don't want to set any preferences on the driver itself, I just need for a specific test to grab the location of a recently saved file.

Any ideas on how i can do this?

Codey
  • 171
  • 7
  • Was the 'recently saved file' auto-downloaded? – Zeeshan S. May 16 '17 at 21:58
  • Yes, that's correct. – Codey May 16 '17 at 22:02
  • 1
    In Windows, any file auto-downloaded is stored in the default downloads folder of the user which can be accessed using: `File dirMyDownloads = new File(System.getProperty("user.home") + "/Downloads/");` is this what you needed? – Zeeshan S. May 16 '17 at 22:07
  • Not quite..... Our test CI has tests running on a number of jenkins machines. They run using randomly generated users, and startup scripts overwrite a number of env. variables. I need a deterministic way to grab the target location from webdriver itself maybe? Or any suggestion on aproach. I already did it by assuming the location is /downloads/, it works fine on my machine, but it does not work on Jenkins.... – Codey May 16 '17 at 22:11
  • 1
    In that case, if you are using Chome in any of your tests, you should access the preferences JSON file. Read more here: http://stackoverflow.com/a/18438722/904375 – Zeeshan S. May 16 '17 at 22:20

0 Answers0