robotframework - 无法在机器人框架中使用“选择文件”关键字上传图像文件。如何使用机器人框架处理图像上传验证?
问题描述
我正在尝试使用机器人框架验证我的应用程序的图像上传功能,我的脚本如下:
*** Variables ***
${browse} xpath=//*[@id="file"]
${path_jpg} ${EXECDIR}\\test_data\\Browse_Image\\apple.jpg
${path_png} ${EXECDIR}\\test_data\\Browse_Image\\apple.png
${path_gif} ${EXECDIR}\\test_data\\Browse_Image\\apple.gif
${path_webm} ${EXECDIR}\\test_data\\Browse_Image\\apple.ppt
Choose File ${browse} ${path_jpg}
该脚本在 chrome 中运行良好,但在 firefox 和 edge 的情况下,会抛出如下错误消息:
火狐:
ElementNotInteractableException:消息:
<input id="file" type="file">
键盘无法访问元素**
边缘:
WebDriverException:消息:元素不可聚焦
如何处理?
解决方案
推荐阅读
- apache - Apache2 和 solr 与 SSL 使用 proxypass
- ios - 包含在 UIBarButtonItem 中时增加 UIButton 的固有大小
- php - 从 php 中的 url 抓取数据,第一个 url 有效,但其他具有相同结构的 url 没有,只有 id 不同
- android - 哪种方法更适合自定义视图:创建新的 Handler 还是使用现有的?
- clojure - 我不确定这个函数如何让线程进入睡眠状态
- javascript - 调用设置的间隔函数时触发倒计时
- python - 如何在 PyCharm 的项目选项卡中跟踪活动项目
- r - How to selectively multiply columns
- rxjs - 最多每 x 秒从流中发出值
- flutter - 如何在书写时隐藏/移动图像