如何从Selenium C打开.ica下载的文件 [英] How to open a .ica downloaded file from selenium c#

查看:174
本文介绍了如何从Selenium C打开.ica下载的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个下面的代码. ds.Click();将一个文件下载到downloads文件夹后,该文件将作为 .ica扩展名.

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();

如何打开该文件?

推荐答案

您无法使用Selenium打开文件.打开文件是操作系统的一部分. Selenium仅驱动浏览器,因此在下载文件之后,Selenium完成.

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.

Selenium下载文件后可以使用的其他一些工具:

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

  • AutoIt: Launching or running ica file with autoit script
  • Sikuli: https://hellotestworld.com/2012/04/27/sikuli-for-all-those-hard-to-reach-places/
  • Coded-UI: https://msdn.microsoft.com/en-us/library/dd286726.aspx?f=255&MSPPError=-2147217396

使用Selenium也无法实现Citrix自动化.

Automating Citrix is also not possible with Selenium.

这篇关于如何从Selenium C打开.ica下载的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆