1

I am able to download a file in selenium in Selenium(chrome) and it shows in the bottom of the browser. I want to open the file automatically after downloading it.

I have tried using the below options but it doesnt seem to work

ChromeOptions options = new ChromeOptions();
HashMap<String, Object> prefs = new HashMap<String, Object>();

prefs.put("download.extensions_to_open", "ica");
prefs.put("download.prompt_for_download", "false");
prefs.put("download.directory_upgrade", "true");
options.setExperimentalOption("prefs", prefs);

DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(ChromeOptions.CAPABILITY, options);

How to make it enable ? And the file i am downloading is of type .ica, it is a citrix file.

Timothy Truckle
  • 15,071
  • 2
  • 27
  • 51
irfan mike
  • 117
  • 2
  • 15
  • 1
    the short answer is you can't with selenium, the long answer is you can with other tools, read this https://stackoverflow.com/questions/42415263/how-to-open-a-ica-downloaded-file-from-selenium-c-sharp – chris-crush-code Oct 02 '17 at 15:32
  • Thanks @chris-crush-code I did by using batch program and running selenium through batch. Good I can achieve it anyway – irfan mike Oct 03 '17 at 08:12
  • @irfanmike would be helpful if you could link to it. The link by Chis is quite a rabbit hole! – Raunak Thomas Aug 30 '20 at 11:21

0 Answers0