1

I have a below code. after ds.Click(); one file will be downloaded to downloads folder, the file will be as a .ica extension.

IWebDriver cobj = new ChromeDriver();

cobj.Navigate().GoToUrl("https://XX.xxx.xx");

IWebElement u = cobj.FindElement(By.Name("login"));
IWebElement p = cobj.FindElement(By.Name("passwd"));
IWebElement b = cobj.FindElement(By.Id("Log_On"));
u.SendKeys("username");
p.SendKeys("password");
b.Click();
IWebElement d = cobj.FindElement(By.Id("folderLink_0"));
d.Click();
IWebElement ds = cobj.FindElement(By.Id("idCitrix.Production"));
ds.Click();

How to open that file?

Christian Gollhardt
  • 16,510
  • 17
  • 74
  • 111
Naveen
  • 21
  • 7

2 Answers2

1

If you want to open in it in the browser, you can use something like that:

cobj.Navigate().GoToUrl("file:///C:/Users/yourUserName/Downloads/image004.jpg");

Just change the file type and so on.

Anton Angelov
  • 1,705
  • 13
  • 16
1

You can't open files with Selenium. Opening files is part of the operating system. Selenium only drives the browser, so after the file is downloaded Selenium is finished.

Some other tools to pick-up after Selenium has downloaded the file:

Automating Citrix is also not possible with Selenium.

Community
  • 1
  • 1
Niels van Reijmersdal
  • 2,038
  • 1
  • 20
  • 36