gpt4 book ai didi

reactjs - Selenium-ide,文件上传不适用于 react 应用程序

转载 作者:行者123 更新时间:2023-12-04 16:43:00 25 4
gpt4 key购买 nike

使用 selenium ide 为 react 应用程序记录测试用例,但无法从 selenium-ide 上传文件。
React-dropzone 包用于文件上传。

尝试使用命令“输入”和“发送 key ”,但没有奏效。

Selenium 化物:3.6.0
Chrome :74.0.3729.108

用 firefox 尝试过,但收到错误消息“目前仅在 Chrome 中支持文件上传”

Command: type
Target: css=input[type=file]
Value: c:\fakepath\test.png
Error: {"code":-32000,"message":"Not allowed"}


Command: send keys
Target: css=input[type=file]
Value: c:\fakepath\test.png
Error: Element is not currently interactable and may not be manipulatedElement is not currently interactable and may not be manipulated

selenium ide 能够上传文件并通过测试用例。

最佳答案

在 Chrome 上,您可以访问:
窗口 > 更多工具 > 扩展 > Selenium IDE > 详细信息

然后打开“允许访问文件 URL”选项。

我遇到了同样的问题,这对我有用。

关于reactjs - Selenium-ide,文件上传不适用于 react 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55917893/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com