2

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.

bumped to the homepage by Community yesterday

This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

  • Do you have a minimal test example and a website that makes the issue occur? – anonygoose Jan 24 at 15:02
0

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

  }); 

});
  • 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 at 15:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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