【问题标题】:Edge Upload File control using Selenium使用 Selenium 进行边缘上传文件控制
【发布时间】:2019-10-11 01:15:51
【问题描述】:

我正在尝试在 Edge 浏览器上使用 Selenium Webdriver 上传文件,是的,我已经下载了 EdgeDriver 并安装了用于测试 Edge 的 MSI。从 Edge 浏览器中单击屏幕上的元素可以正常工作。问题是上传文件控制。我的代码如下:

IWebElement fileUploader2 = Browser.Driver.FindElements(By.CssSelector("input[type='file']"))[0];
        fileUploader2.SendKeys(FileUtility.FileUploadsDirectory + "\\sample-account_balances.xlsx");

上面的代码适用于 Chrome 和 Firefox,但不适用于 Edge。这是一个 ReactJS 网络应用程序。我已经尝试了以下与我上面的代码类似的建议,但我似乎无法使用 Selenium Webdriver 以编程方式使用控件上传文件。没有错误,因为它只是没有单击将文本发送到文件上传控件。什么都不执行:

How to upload file using Selenium Webdriver?

File Control on Edge

DOM Upload Control Edge

【问题讨论】:

    标签: selenium-webdriver


    【解决方案1】:

    不幸的是,该功能尚未添加到边缘网络驱动程序中。我遇到了同样的问题,还没有找到合适的解决方案。一种(诚然不是理想的)解决方案是使用 AutoIt 自动为边缘上传文件。 There are multiple reports of this issue, but here's one of the latest reports showing that its an issue with the edge driver.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-09-16
      • 2016-06-10
      • 2018-02-24
      相关资源
      最近更新 更多