如何解决在 IE11 上发送密钥后,量角器文件上传挂起适用于 Chrome/Firefox
我有一个量角器/黄瓜脚本,可以在 chrome/firefox 上成功上传文件。当我在 IE11 上运行相同的脚本时,网站挂起,文件对话框打开,没有发送文件。
我收到的唯一错误消息是“UnsupportedOpperationError:错误 404:未找到。”
我上传的 html 是基本的 <input name="myFile" type="file?
我也发送了绝对路径:C:\fullpath
我使用 selenium 独立服务器 3.5.0 和 IEDriver 3.4.0(32 位)
根据我的研究,IE 和安全或高级设置存在问题。不幸的是,由于这是一个商业项目,我无法为 IE 配置设置。解决方法是将 ignoreProtectedModeSettings: true
添加到功能中。对于我的能力,我使用了
capabilites : {
browserName: 'internet explorer',platform: 'windows',version: '11',maxInstances: 1,ignoreProtectedModeSettings: true,'ie.fileUploadDialogTimeout': 10000 //I read this might have been an issue but didn't change anything
nativeEvents: true,unexpecteDalertBehavior: 'accept',enablePersistentHover: true,ignoreZoomSettings: true,requireWindowsFocus: true,'disable-popup-blocking': true,javascriptEnabled: true,restartbrowserBetweenTests: true,INTRODUCE_FLAKInesS_BY_IGnorING_Security_DOMAINS: true
}
我上传文件的代码也是基本的element(by.css('input[type="file"])).sendKeys(absolutePath)
任何想法或示例都会有所帮助,谢谢。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。