Unexpected Alert Open Error. "browser.switchTo().alert().accept();" works fine in firefox but not in Chrome when running through Jenkins
<p>How to handle this error in chrome browser using protractor.
<a href="https://i.stack.imgur.com/7Fm4l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7Fm4l.png" alt="enter image description here"></a></p>

<p>Chrome driver through's following error: <strong>UnexpectedAlertOpenError: unexpected alert open: {Alert text : There are unsaved data, please save before you leave, otherwise your changes get lost!}</strong>
I have used "browser.switchTo().alert().accept();" but this is not working, works fine in firefox. Please help me, help is greatly appreciated.</p>