Styrow.dev
Question 30 of 36

How to cancel Alert in Protractor?

Question

How to cancel Alert in Protractor?

Answer

By using dismiss() method of Alerts class, we cancel or close alerts in Protractor.

Note: We have to switch the control to the alert using switchTo().alert() before cancel the alert.