question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to visit a site using Cypress. Getting access denied.

See original GitHub issue

Current behavior

I am trying to visit a website using cypress to test file upload. When I use Cypress it shows access denied. But when I tried using Selenium it worked fine.

Code to reproduce

describe('Test upload file with cypress',function(){
    beforeEach(function(){
        cy.visit('https://easyupload.io',{failOnStatusCode: false});
    })
    it('upload pdf file',() =>{
        cy.get('form#dropzone').attachFile(
            {
                filePath: 'example.json',
                mimeType: 'document/json',
                encoding: 'binary'
            },
            {
                subjectType: 'drag-n-drop',
                force: true,
            })
        cy.wait(2000);
    });
})

Cypress Version

7.7.0

Screenshot

image

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
bruno88cabralcommented, Jun 1, 2022

any news on this case?

1reaction
Sumedh-kcommented, Jul 30, 2021

Cloudflare is blocking the request. You should look at the network traffic and see what headers Selenium sends and then compare that with Cypress.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Web Security - Cypress Documentation
Because of the way Cypress is designed, if you are testing an HTTPS site, Cypress will error anytime you attempt to navigate back...
Read more >
Cypress can't access a website from its automated browser ...
I have a script with Cypress.io that basically access a website and clicks on a link for LOGIN. I have reduced the code...
Read more >
Controlling Browser Permissions in Cypress End-to-End Tests
It helps control the permission level of various browser features such as: Desktop Notifications; Geolocation; Images; Camera; Microphone; etc.
Read more >
cypress-io/cypress - Gitter
While running the test in AzureDevOps CI/CD I am getting an error..."Failed to read the 'localStorage' property from 'Window': Access is denied for...
Read more >
Give Chrome Browser Clipboard Permissions from Cypress Test
Using " Cypress.automation" command and Chrome Debugger Protocol we can access the clipboard text from the Cypress test to verify the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found