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

Bha*_*ary 3 file-upload selenium-ide reactjs react-dropzone

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

尝试使用命令“键入”和“发送密钥”,但没有奏效。

硒化物:3.6.0 铬: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
Run Code Online (Sandbox Code Playgroud)

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

And*_*rio 6

在 Chrome 上,您可以转到:Window > More Tools > Extensions > Selenium IDE > Details

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

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