Search code examples
reactjsfile-uploadselenium-idereact-dropzone

Selenium-ide, File upload not working for react application


Recording the test case using Selenium IDE for react application, but unable to Upload a file from selenium-ide. React-dropzone package is used for file upload.

I tried with command "type" and "send keys" but that didn't work.

selenium-ide: 3.6.0

chrome: 74.0.3729.108

I tried with Firefox but got an error message:

File uploading is only supported in Chrome at this time

Logger:

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

Is Selenium IDE able to upload a file and pass the test case?


Solution

  • On Chrome you can go to: Window > More Tools > Extensions > Selenium IDE > Details

    Then turn on the 'Allow access to file URLs' option.

    I was having the same problem and this worked for me.