4

2 days ago I have started to receive unexpected alerts when leaving the page (actions that change the URL really). (those alerts do not appear in a 'real' browser).

I have checked the compatibility between Chrome and Chromedriver, but the versions are compatible)

Here is the error trace. (You can see the versions of Chrome and Chromedriver)

Failed: unexpected alert open: {Alert text : }
    (Session info: chrome=71.0.3578.98)
    (Driver info: chromedriver=2.45.615291 (ec3682e3c9061c10f26ea9e5cdcf3c53f3f74387),platform=Windows NT 10.0.17134 x86_64)

Is anyone else having this problem?

I have tried the following (without any success), as the alerts can be displayed triggered by many actions, but it did not work.

 capabilities: {             //conf.js
        'browserName': 'chrome',
        'unexpectedAlertBehaviour': 'ignore'
}

Using 'accept' or 'dismiss' do not work either.

I am running out of ideas, so any advice is welcome.

2
  • Do you have a minimal test example and a website that makes the issue occur?
    – anonygoose
    Jan 24, 2019 at 15:02
  • What do you mean by "those alerts do not appear in a 'real' browser" ? Jun 29, 2019 at 14:21

2 Answers 2

1

Yep, found few solutions: here

What worked for me is:

browser.get(url).catch(function () {

  return browser.switchTo().alert().then(function (alert) {

      alert.accept();
      return browser.get(url);

  }); 

});
1
  • Thanks @Michal Dobrzycki! I also use this solution and the result was the same, The issue seems to be something around communication in our own system.
    – Bpozo
    Mar 7, 2019 at 15:09
0

You should also try "--disable-notifications" for chromeOptions

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.