Replies: 1 comment
-
bump,, anybody? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to automate uploading a picture on a website. I can manually upload fine. But when I do it using Cypress and node module cypress-file-upload, I get 500 server error. I have import 'cypress-file-upload'; in commands.js file. I have
Cypress.on('uncaught:exception', (err, runnable) => {
return false;
});
I get application threw an error if I do not have this exception code.
This is what my code looks like for upload
cy.fixture('settings.JPG').then(fileContent => {
cy.get('[id="xyz"]').attachFile({
fileContent: fileContent.toString(),
fileName: 'settings.JPG',
mimeType: 'image/jpg'
});
});
As I look at browser where cypress is running, I can see, file is being attached near the Choose file field. But as soon Cypress clicks on the submit button, it throws 500 error
If I go to Cypress view pane and click on the submit button, it throws 500 error again But if I click on the choose file and select the same file and then click on Submit button, then I do not get 500 error and it works.
Can anyone please point out why I am getting 500 error? and what can I do to get past this? Thanks a bunch in advance.
Beta Was this translation helpful? Give feedback.
All reactions