Error: ResizeObserver loop limit exceeded

1.3k views Asked by At

I'm trying to automate a login through google in some application, and i received this error message: (uncaught exception)Error: ResizeObserver loop limit exceeded Error The following error originated from your application code, not from Cypress.

ResizeObserver loop limit exceeded

When Cypress detects uncaught errors originating from your application it will automatically fail the current test.

This behavior is configurable, and you can choose to turn this off by listening to the uncaught:exception event.

this is my code :

describe('empty spec', () => {
  it('login multi domain ', () => {
    cy.visit('/login');
    cy.get('form > .flex').click({force:true});


    cy.origin(`https://accounts.google.com`, ()=>{
        cy.get("#identifierId").type("user");
        cy.get(".VfPpkd-LgbsSe-OWXEXe-k8QpJ").click({force:true});
        cy.get(`#password`).type("pass");
        cy.get(".VfPpkd-LgbsSe-OWXEXe-k8QpJ").click({force:true});
    })
  })
})

Thanks in advance

1

There are 1 answers

8
Ali Suliman On

You can see from the message that it's an error in the app. This section of the documentation gives some recommendation To turn off all uncaught exception handling of how to by-pass the error for testing purposes.

This would be the conservative way to do it

  Cypress.on('uncaught:exception', (err, runnable) => {
    if (err.message.includes('ResizeObserver loop limit exceeded')) {
      // ignore the error
      return false   
    }
  })

With the if() statement, you are only ignoring that particular error.

According to this question ResizeObserver - loop limit exceeded the message is benign and can be ignored.