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?

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.