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()

Related questions

0 votes
asked Apr 5, 2021 in Protractor by Robindeniel
0 votes
asked Apr 5, 2021 in Protractor by Robindeniel
...