【发布时间】:2021-08-31 07:59:11
【问题描述】:
我正在尝试通过发送密钥(文件路径)使用 Selenium 上传文件。它可以工作,但它也会打开文件选择器对话框,并且永远不会关闭。虽然它不会出现任何问题,但在 headless 中它会使测试失败并出现错误:Failed to decode response from marionette 或 Tried to run command without establishing a connection。
如何防止文件选择器对话框打开?我试过this solution,但它似乎不起作用。
【问题讨论】:
标签: javascript selenium unit-testing firefox geckodriver