Unexpected Alert Open Error. “browser.switchTo().alert().accept();” works fine in firefox but not in Chrome when running through Jenkins

巧了我就是萌 提交于 2019-12-09 18:36:04

问题


How to handle this error in chrome browser using protractor.

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


回答1:


today, after struggling with this new problem for the past week or so, we found that the problem was fixed by using the latest Protractor version. Changing the package.json to "protractor": "*" did the job.



来源:https://stackoverflow.com/questions/38779693/unexpected-alert-open-error-browser-switchto-alert-accept-works-fine-i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!