1

I am attempting to test a Dropzone.js form using Protractor. This method of uploading to a file input using Protractor is not working for me.

Dropzone does create a hidden <input type="file"> element to handle the upload, but when I sendKeys to it, I get the error:

Server responded with 0 code.

It also shows that 0 bytes were sent. I opened up Charles and confirmed that no POST request is made to the upload route defined on my dropzone form.

I found this question/answer, which suggests adding a second <input type="file"> and then creating a drop event, but I don't have a window element when running Protractor tests, so I'm not really sure that it translates.

How can I trigger a Dropzone.js upload in a Protractor/Jasmine test session?

Community
  • 1
  • 1
Ben Harold
  • 6,242
  • 6
  • 47
  • 71

1 Answers1

0

Once again I have posted a question looking for the wrong answer. There is nothing special about Dropzone. Just make sure that the path you are sending to the <input type="file"> element points to an actual file. It works fine.

Ben Harold
  • 6,242
  • 6
  • 47
  • 71