0 votes
in Protractor by

How to cancel Alert in Protractor?

1 Answer

0 votes
by

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.

browser.switchTo().alert().dismiss()

browser.switchTo().alert().dismiss()

...