简体   繁体   中英

Error: ResizeObserver loop limit exceeded

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM