Protractor: Protractor tests failing with reason "Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL." after upgrading to chrome 64

Created on 8 Feb 2018  路  20Comments  路  Source: angular/protractor

Hi ,

My E2E tests are failing with reason : "Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL." after upgrading to chrome 64. Works well when downgraded to chrome 63.

Has any one experienced this ?

Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
at Timeout._onTimeout (/src/tests/node_modules/protractor/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:4432:23)
at ontimeout (timers.js:475:11)
at tryOnTimeout (timers.js:310:5)
at Timer.listOnTimeout (timers.js:270:5)

Node Version: 8.6.0
Protractor Version: 5.3.0
Angular Version: 5
Browser(s): Google Chrome Version 64
Operating System : MAC , High Sierra 10.13
Chromedriver version 2.35

Most helpful comment

We had the same issue and the solution for adding --disable-browser-side-navigation worked for us. We believe this issue was being caused by calling browser.driver.get() with a URL that has Angular's hashed url pattern, where Angular may make quick browser redirects in the background, which may trip up Protractor.

We did some quick googling and saw this thread on a google-groups for an upcoming (at the time) chromium feature, which may have been enabled for everybody in the most recent version of chrome (64.x)

https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/FmWJ4d7oBCc

All 20 comments

I have similar issues with Chrome version 64. Running on Windows 7 and some tests time out. Rollback to version 63 and working fine. No sure if there will be a fix to this.

@21stChannel , I did roll back to 63 and it works too. But would like to know from the devteam if there is a fix in the near future ?

@sri1987 Have you tried adding chrome command line switch in your conf file like this? This is working for me, not sure if it will work on yours.

capabilities: {
    'browserName': 'chrome',
    'chromeOptions': {
      args: ['--disable-browser-side-navigation'] 
    }   
}

Reference:
https://bugs.chromium.org/p/chromedriver/issues/detail?id=2239

@21stChannel , that helps! Thank you very much. But after adding the command line , i see a new issue some thing like :

Failed: stale element reference: element is not attached to the page document
(Session info: chrome=64.0.3282.140)
(Driver info: chromedriver=2.35.528157 (4429ca2590d6988c0745c24c8858745aaaec01ef),platform=Mac OS X 10.13.3 x86_64)

Did you experience this behaviour ?

@sri1987 I don't think this issue is quite related to the fix. Stale element reference usually happens when you do some page refreshing and try to get the reference to an element. If your page is not refreshing fast (perhaps the fix results in this?), then we may be getting an old reference to the element.

I'm going to add some information here to help with a fix.

The change above (--disable-browser-side-navigation) fixed the issue with chrome 64 for me. I was ONLY seeing that issue when running chrome headless, When running chrome 64 without the --headless flag, Everything worked normally.

My capabilities object now looks as follows:

capabilities: {
browserName: 'chrome',
chromeOptions: {
args:["--headless", "--disable-gpu", "window-size=1920, 1080", "--disable-browser-side-navigation"]
}
}

@Isaak-Malers - headless works for me too.

We had the same issue and the solution for adding --disable-browser-side-navigation worked for us. We believe this issue was being caused by calling browser.driver.get() with a URL that has Angular's hashed url pattern, where Angular may make quick browser redirects in the background, which may trip up Protractor.

We did some quick googling and saw this thread on a google-groups for an upcoming (at the time) chromium feature, which may have been enabled for everybody in the most recent version of chrome (64.x)

https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/FmWJ4d7oBCc

I got the same problem, but the solutions provided here did not work for me. If you have time, please have a look to my question on Stack Overflow. The problem can easily be reproduced and I have a repo.
https://stackoverflow.com/questions/53786401/error-debugging-protractor-with-node-8-async-await-and-angular-6

This started happening again in Chrome 80. Has anyone else run into it or have ideas of what might be going on?

It does not seem to be Protractor's issue. It's just Jasmine timeout. It often happens when you have some waiting mechanism, that waits longer than timeout. Or some might be some unhandled promise. It's quite hard to say what is wrong without code example

here same with crome 80. I think it is not a waiting mechanisme. I have waiting to appear with timeout 25 s (in know thats long) but see the the test crashing without any waiting. I look to me that somehow no timeout is used

Same issue with chrome 81. Am new to Protractor. Learning on the way.

expect(inGES.fFRD(params)).toBeGreaterThan(0)

Actually there are 2 tests, whose actions are completing as expected. Despite this, the error is being thrown up. What could be the reason ?

Same Issue with chrome 81. I have gone through the Stack Over Flow Solutions. Nothing works for me

i'm also facing the same issue after navigating to the different page .

@Noman46 @harsha8020 can you provide a section of the code which is failing for you?

 it('should login and logout', async function () {
        await browser.get("https://example.com/#login");
        await element(by.model('vm.form.userName')).sendKeys("username");
        await element(by.model('vm.form.password')).sendKeys("password");
        await $('[ng-click="vm.Login()"]').click();
        // Logout
        await element(by.id('user-menu')).click();
        await $('[ng-click="vm.logout()"]').click();
  })

@Fuun347
it's logging in after navigating to dashboard nothing working,
it was working file till last month all of a sudden it stopped working.

@harsha8020 Have you tried using browser.navigate().to(url). It's a workaround, but I've seen that get and navigate.to have slightly different behaviors.

@harsha8020 if you're navigating to a page that does not contain angular, you need to do:
await browser.waitForAngularEnabled(false);
await browser.get(url);

@Fuun347
The problem is not with browser.get() , because it's working for me with browser.get() and i'm able to login , the problem starts only after login.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tmeneau picture tmeneau  路  3Comments

mvolkmann picture mvolkmann  路  3Comments

luakri picture luakri  路  3Comments

andyman3693 picture andyman3693  路  3Comments

smarts picture smarts  路  3Comments