Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Random failing tests in waitForAngular (IE11) #1999

Closed
andrenarchy opened this issue Apr 2, 2015 · 12 comments
Closed

Random failing tests in waitForAngular (IE11) #1999

andrenarchy opened this issue Apr 2, 2015 · 12 comments

Comments

@andrenarchy
Copy link

We see a lot of random failing tests with Internet Explorer 11. The error message (see also here) always points to a timeout in Protractor.waitForAngular():

[iexplore #3] Failures:
[iexplore #3] 
[iexplore #3]   1) PaperHub homepage Test page title
[iexplore #3]    Message:
[iexplore #3]      �[31mScriptTimeoutError: Timeout expired waiting for async script (WARNING: The server did not provide any stacktrace information)
[iexplore #3] Command duration or timeout: 4.09 seconds
[iexplore #3] Build info: version: '2.40.0', revision: 'fbe29a9', time: '2014-02-19 20:54:28'
[iexplore #3] System info: host: 'WIN-8LIIH1BGM1D', ip: '172.20.27.132', os.name: 'Windows Server 2008 R2', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_60'
[iexplore #3] Session ID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXc5e9d7c9
[iexplore #3] Driver info: org.openqa.selenium.ie.InternetExplorerDriver
[iexplore #3] Capabilities [{platform=WINDOWS, javascriptEnabled=true, elementScrollBehavior=0, ignoreZoomSetting=false, enablePersistentHover=true, ie.ensureCleanSession=false, browserName=internet explorer, enableElementCacheCleanup=true, unexpectedAlertBehaviour=dismiss, version=11, ie.usePerProcessProxy=false, cssSelectorsEnabled=true, ignoreProtectedModeSettings=false, requireWindowFocus=false, handlesAlerts=true, initialBrowserUrl=about:blank, ie.forceCreateProcessApi=false, nativeEvents=true, browserAttachTimeout=0, ie.browserCommandLineSwitches=, takesScreenshot=true}]�[0m
[iexplore #3]    Stacktrace:
[iexplore #3]      ScriptTimeoutError: Timeout expired waiting for async script (WARNING: The server did not provide any stacktrace information)
[iexplore #3] Command duration or timeout: 4.09 seconds
[iexplore #3] Build info: version: '2.40.0', revision: 'fbe29a9', time: '2014-02-19 20:54:28'
[iexplore #3] System info: host: 'WIN-8LIIH1BGM1D', ip: '172.20.27.132', os.name: 'Windows Server 2008 R2', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_60'
[iexplore #3] Session ID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXc5e9d7c9
[iexplore #3] Driver info: org.openqa.selenium.ie.InternetExplorerDriver
[iexplore #3] Capabilities [{platform=WINDOWS, javascriptEnabled=true, elementScrollBehavior=0, ignoreZoomSetting=false, enablePersistentHover=true, ie.ensureCleanSession=false, browserName=internet explorer, enableElementCacheCleanup=true, unexpectedAlertBehaviour=dismiss, version=11, ie.usePerProcessProxy=false, cssSelectorsEnabled=true, ignoreProtectedModeSettings=false, requireWindowFocus=false, handlesAlerts=true, initialBrowserUrl=about:blank, ie.forceCreateProcessApi=false, nativeEvents=true, browserAttachTimeout=0, ie.browserCommandLineSwitches=, takesScreenshot=true}]
[iexplore #3] ==== async task ====
[iexplore #3] Protractor.waitForAngular()
[iexplore #3]     at [object Object].<anonymous> (/home/travis/build/paperhub/paperhub-frontend/test/spec.js:5:20)
[iexplore #3] ==== async task ====
[iexplore #3] Asynchronous test function: it()
[iexplore #3] Error
[iexplore #3]     at [object Object].<anonymous> (/home/travis/build/paperhub/paperhub-frontend/test/spec.js:2:3)
[iexplore #3]     at Object.<anonymous> (/home/travis/build/paperhub/paperhub-frontend/test/spec.js:1:63)
[iexplore #3] 
[iexplore #3] Finished in 8.197 seconds
[iexplore #3] �[31m1 test, 1 assertion, 1 failure

Do you have any hints? Possibly this is related to #1476.

@juliemr
Copy link
Member

juliemr commented Apr 2, 2015

4 seconds seems like a pretty slow timeout for the async script. Have you changed any timeout settings anywhere? Maybe the default for IE is getting set incorrectly in some way.

@andrenarchy
Copy link
Author

There's only one timeout setting in the config and it is set to 60 seconds. Do you see any other suspicious code in the config that could be related? :)

@juliemr
Copy link
Member

juliemr commented Apr 2, 2015

No, your config looks good to me. We'll investigate!

@andrenarchy
Copy link
Author

Thx!

@luisuribe
Copy link

I'm having the same problem, is there a way to debug this by ourselves or to send more information about it?

@racerbajs
Copy link

I too have the same problem. A for loop that works flawlessly in Chrome / Firefox fails with the same message as in OP.
I've tried increasing allScriptsTimeout: xyz, to no avail. The test just times out after the set time.

Let me know if I can help by providing the test.

@drptbl
Copy link

drptbl commented Sep 1, 2015

👍

@racerbajs
Copy link

Sorry for the delay, I've had a man cold for a couple of days...

Here's my test below. It's supposed to create _number of systems, but what happens is in IE the test times out after first iteration (so only one system is created). In Chrome and Firefox the test works fine.

Let me know if you need any more info.


this.createSystems = function (number) { //create i number of systems

    //TODO: FAILS IN IE AFTER ONE ITERATION......

    var testSystemName = "System #";
    var testSystemDescription = "SystemDescription #";

    browser.get(toolKitUrl);

    function create(x) {
        toolKitPage.systemDropDown.click();
        toolKitPage.systemDropDown_CreateSystem.click();

        toolkitSystemCreatePage.systemName.clear();
        toolkitSystemCreatePage.systemDescription.clear();

        var field = toolkitSystemCreatePage.Description;
        var value = "{}";

        field.clear();
        _completeInput(field,value );

        function _completeInput(field, value) {
            return field.getAttribute('value').then(function(v) {
                if (v.length < value.length) {
                    field.clear()
                    return field.sendKeys(value).then(function() {
                        return _completeInput(field, value);
                    });
                };
            });
        };

        toolkitSystemCreatePage.systemName.sendKeys(testSystemName + x);
        toolkitSystemCreatePage.systemDescription.sendKeys(testSystemDescription + x);
        toolkitSystemCreatePage.createButton.click();
    }

    var funcs = [];

    for (var i = 0; i < number; i++) {
        funcs[i] = create.bind(this, i);
    }

    for (var j = 0; j < number; j++) {
        funcs[j]();
    }

};

@Chexpir
Copy link

Chexpir commented Oct 26, 2015

I have plenty of flakiness examples (tests that randomly fail) in IE11 but works perfectly in Chrome. I don't think people is using IE11 in production e2e tests, as it is impossible.

@evilaliv3
Copy link
Contributor

I confirm that the timeout time seems being set randomly:

Failed: Error while running testForAngular: Timeout expired waiting for async script (WARNING: The server did not provide any stacktrace information)
    Command duration or timeout: 330 milliseconds

i've not set any timeout manually, and this number is that low for a timeout and everytime changing.

@juliemr maybe the setting used by testForAngular is using a call to a function that is instable during the browser startup?

@sawpresto
Copy link

Any updates on this issue? I'm running Protractor 3.3.0 and WebDriver 10.0.1 against IE 11 and I'm getting the same result after changing the getPageTimeout property. Thanks!

@cnishina
Copy link
Contributor

cnishina commented Dec 22, 2016

After investigation, I cannot get this to reproduce this with the IEDriver 32-bit version.

Example:

spec
https://github.com/angular/protractor-cookbook/blob/master/protractor-typescript/spec.ts

config

import {Config} from 'protractor';

export let config: Config = {
  seleniumAddress: 'http://127.0.0.1:4444/wd/hub',
  capabilities: {
    browserName: 'internet explorer'
  },
  specs: ['spec.js']
}

When using IEDriver 32-bit:

> npm run test-example

> [email protected] test-example C:\Users\test\src\protractor-cookbook\protractor-typescript
> protractor tmp/example/config.js

[11:41:31] I/hosted - Using the selenium server at http://127.0.0.1:4444/wd/hub
[11:41:31] I/launcher - Running 1 instances of WebDriver
Started
.....

5 specs, 0 failures
Finished in 11.721 seconds
[11:41:46] I/launcher - 0 instance(s) of WebDriver still running
[11:41:46] I/launcher - internet explorer #01 passed

When starting up the same test with IEDriver x64:

[11:38:09] I/hosted - Using the selenium server at http://127.0.0.1:4444/wd/hub
[11:38:09] I/launcher - Running 1 instances of WebDriver
Started
..A Jasmine spec timed out. Resetting the WebDriver Control Flow.
F..

Failures:
1) slow calculator memory should fill the memory with past results
  Message:
    Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
  Stack:
    Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
        at ontimeout (timers.js:365:14)
        at tryOnTimeout (timers.js:237:5)
        at Timer.listOnTimeout (timers.js:207:5)

5 specs, 1 failure
Finished in 51.658 seconds
[11:39:04] I/launcher - 0 instance(s) of WebDriver still running
[11:39:04] I/launcher - internet explorer #01 failed 1 test(s)
[11:39:04] I/launcher - overall: 1 failed spec(s)
[11:39:04] E/launcher - Process exited with error code 1

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "test-example"
npm ERR! node v6.9.2
npm ERR! npm  v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! [email protected] test-example: `protractor tmp/example/config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test-example script 'protractor tmp/example/config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the protractor-typescript package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     protractor tmp/example/config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs protractor-typescript
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls protractor-typescript
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\test\src\protractor-cookbook\protractor-typescript\npm-debug.log
npm ERR! Test failed.  See above for more details.

Why use 32-bit over x64?

This has been reported many times that the 64-bit version (for whatever reason) is much slower than the 32-bit version. We recommend using the 32-bit version to avoid flakiness. How do you know if you are using IEDriver 32-bit?

Make sure you use the --ie32 flag:

webdriver-manager update --ie32
webdriver-manager start --ie32

In the webdriver-manager logs, you should see the IEDriver 32-bit version with something like IEDriverServer_Win32_2.53.1.exe:

$ ./node_modules/.bin/webdriver-manager start --ie32
[11:47:47] I/start - java 
  -Dwebdriver.chrome.driver=C:\Users\test\src\protractor-cookbook\protractor-typescript\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver_2.26.exe 
  -Dwebdriver.gecko.driver=C:\Users\test\src\protractor-cookbook\protractor-typescript\node_modules\protractor\node_modules\webdriver-manager\selenium\geckodriver-v0.11.1.exe 
  -Dwebdriver.ie.driver=C:\Users\test\src\protractor-cookbook\protractor-typescript\node_modules\protractor\node_modules\webdriver-manager\selenium\IEDriverServer_Win32_2.53.1.exe 
  -Dwebdriver.edge.driver=C:\Program Files (x86)\Microsoft Web Driver\MicrosoftWebDriver.exe 
  -jar C:\Users\test\src\protractor-cookbook\protractor-typescript\node_modules\protractor\node_modules\webdriver-manager\selenium\selenium-server-standalone-2.53.1.jar -port 4444
[11:47:47] I/start - seleniumProcess.pid: 12276
11:47:47.180 INFO - Launching a standalone Selenium Server
11:47:47.259 INFO - Java: Oracle Corporation 25.111-b14
11:47:47.259 INFO - OS: Windows 10 10.0 x86

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants