2

I am learning cypress automation tool and have knowledge about basic concepts. So I tried to automate the Microsoft outlook login page as like normal login page but I am getting an error of "unhandled promise rejection".

My code looks like below,

it('Outlook', ()=> {
        cy.visit('https://outlook.office.com/mail/')
            cy.get('#i0116').clear().type('hello@gmail.com')
            cy.get('#idSIButton9').click()
            cy.get('#3i0118').clear().type('Password@123')
            cy.get('#idSIButton9').click()   
    })

I tried adding the below code but I couldn't resolve the issue,

Cypress.on('uncaught:exception',(err,runnable,Promise)=>{
    if(Promise){
        return false
    }
})

Error description:

enter image description here

Leonardo
  • 2,439
  • 33
  • 17
  • 31

1 Answers1

1

As it's suggested in the documentation, you shouldn't use applications that you don't control. So try to run an application locally and write tests for it. For example: Cypress applications or download example of Angular Tour of Heroes app.

krishoot
  • 11
  • 2