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

Generic "JavaScript error" when trying to run Protractor with Internet Explorer 11 on a Jenkins Slave (Windows Server 2016) #4666

Open
wOOx92 opened this issue Jan 18, 2018 · 1 comment

Comments

@wOOx92
Copy link

wOOx92 commented Jan 18, 2018

Hi there!

I'm getting a generic "JavaScript error" when trying to run Protractor with Internet Explorer (11) on a Jenkins Slave with Windows Server 2016.

When I try to run the tests locally via remote desktop connection on the Windows Server 2016 everything is fine and no error appears. But if I try to run them via Jenkins (Windows Server is attached as Slave to the Jenkins Master), the following error appears. If I let Jenkins run the tests with Chrome and Firefox, everything is fine too, only Internet Explorer 11 fails.

I think there is something wrong with the IEDriverServer.exe or somehow the JavaScript fails when Jenkins try to execute it in IE11.

`> protractor

(node:6020) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[17:00:50] I/launcher - Running 1 instances of WebDriver
[17:00:50] I/local - Starting selenium standalone server...
[17:00:52] I/local - Selenium standalone server started at http://XX.XX.XX.XXX:62563/wd/hub
App
Started
Jasmine started
�[31mF�[0mA Jasmine spec timed out. Resetting the WebDriver Control Flow.

App
�[31m× should have a title�[39m
�[31m- �[39m�[31mJavascriptError: JavaScript error
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'FDHPT4GRID01', ip: '10.168.11.153', os.name: 'Windows Server 2016', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_151'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{proxy=Proxy(), acceptInsecureCerts=false, browserVersion=11, se:ieOptions={nativeEvents=true, browserAttachTimeout=0.0, ie.ensureCleanSession=false, elementScrollBehavior=0.0, enablePersistentHover=true, ie.browserCommandLineSwitches=, ie.forceCreateProcessApi=false, requireWindowFocus=false, initialBrowserUrl=http://localhost:37941/, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000.0, ignoreProtectedModeSettings=false}, timeouts={implicit=0.0, pageLoad=300000.0, script=30000.0}, browserName=internet explorer, pageLoadStrategy=normal, javascriptEnabled=true, platformName=windows, setWindowRect=true, platform=ANY}]
Session ID: dadefce0-dd38-425d-b9d8-5122feb2fca8�[39m
�[32m.�[0m �[32m√ should have

�[39m
�[32m.�[0m �[32m√ should have �[39m
�[32m.�[0m �[32m√ should have �[39m

Failures:

  1. App should have a title
    Message:
    �[31m JavascriptError: JavaScript error
    Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
    System info: host: 'FDHPT4GRID01', ip: '10.168.11.153', os.name: 'Windows Server 2016', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_151'
    Driver info: org.openqa.selenium.ie.InternetExplorerDriver
    Capabilities [{proxy=Proxy(), acceptInsecureCerts=false, browserVersion=11, se:ieOptions={nativeEvents=true, browserAttachTimeout=0.0, ie.ensureCleanSession=false, elementScrollBehavior=0.0, enablePersistentHover=true, ie.browserCommandLineSwitches=, ie.forceCreateProcessApi=false, requireWindowFocus=false, initialBrowserUrl=http://localhost:37941/, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000.0, ignoreProtectedModeSettings=false}, timeouts={implicit=0.0, pageLoad=300000.0, script=30000.0}, browserName=internet explorer, pageLoadStrategy=normal, javascriptEnabled=true, platformName=windows, setWindowRect=true, platform=ANY}]
    Session ID: dadefce0-dd38-425d-b9d8-5122feb2fca8�[0m
    Stack:
    JavascriptError: JavaScript error
    Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
    System info: host: 'FDHPT4GRID01', ip: '10.168.11.153', os.name: 'Windows Server 2016', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_151'
    Driver info: org.openqa.selenium.ie.InternetExplorerDriver
    Capabilities [{proxy=Proxy(), acceptInsecureCerts=false, browserVersion=11, se:ieOptions={nativeEvents=true, browserAttachTimeout=0.0, ie.ensureCleanSession=false, elementScrollBehavior=0.0, enablePersistentHover=true, ie.browserCommandLineSwitches=, ie.forceCreateProcessApi=false, requireWindowFocus=false, initialBrowserUrl=http://localhost:37941/, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000.0, ignoreProtectedModeSettings=false}, timeouts={implicit=0.0, pageLoad=300000.0, script=30000.0}, browserName=internet explorer, pageLoadStrategy=normal, javascriptEnabled=true, platformName=windows, setWindowRect=true, platform=ANY}]
    Session ID: dadefce0-dd38-425d-b9d8-5122feb2fca8
    at Object.checkLegacyResponse (C:\Jenkins\workspace\TestProject\TEST (trunk)\node_modules\selenium-webdriver\lib\error.js:546:15)
    at parseHttpResponse (C:\Jenkins\workspace\TestProject\TEST (trunk)\node_modules\selenium-webdriver\lib\http.js:509:13)
    at doSend.then.response (C:\Jenkins\workspace\TestProject\TEST (trunk)\node_modules\selenium-webdriver\lib\http.js:441:30)
    at
    at process._tickCallback (internal/process/next_tick.js:188:7)
    From: Task: WebDriver.executeScript()
    at thenableWebDriverProxy.schedule (C:\Jenkins\workspace\TestProject\TEST (trunk)\node_modules\selenium-webdriver\lib\webdriver.js:807:17)
    at thenableWebDriverProxy.executeScript (C:\Jenkins\workspace\TestProject\TEST (trunk)\node_modules\selenium-webdriver\lib\webdriver.js:878:16)
    at run (C:\Jenkins\workspace\TestProject\TEST (trunk)\node_modules\protractor\built\browser.js:59:33)
    at ProtractorBrowser.to.(anonymous function) [as executeScript] (C:\Jenkins\workspace\TestProject\TEST (trunk)\node_modules\protractor\built\browser.js:67:16)
    at Suite.describe (C:\Jenkins\workspace\TestProject\TEST (trunk)\src\app\app.component.e2e-spec.js:10:11)
    at Object. (C:\Jenkins\workspace\TestProject\TEST (trunk)\src\app\app.component.e2e-spec.js:1:63)
    at Module._compile (module.js:643:30)

4 specs, 1 failure
Finished in 9.64 seconds


  •                Failures                    *
    

  1. App should have a title
    �[31m- �[39m�[31mJavascriptError: JavaScript error
    Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
    System info: host: 'FDHPT4GRID01', ip: '10.168.11.153', os.name: 'Windows Server 2016', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_151'
    Driver info: org.openqa.selenium.ie.InternetExplorerDriver
    Capabilities [{proxy=Proxy(), acceptInsecureCerts=false, browserVersion=11, se:ieOptions={nativeEvents=true, browserAttachTimeout=0.0, ie.ensureCleanSession=false, elementScrollBehavior=0.0, enablePersistentHover=true, ie.browserCommandLineSwitches=, ie.forceCreateProcessApi=false, requireWindowFocus=false, initialBrowserUrl=http://localhost:37941/, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000.0, ignoreProtectedModeSettings=false}, timeouts={implicit=0.0, pageLoad=300000.0, script=30000.0}, browserName=internet explorer, pageLoadStrategy=normal, javascriptEnabled=true, platformName=windows, setWindowRect=true, platform=ANY}]
    Session ID: dadefce0-dd38-425d-b9d8-5122feb2fca8�[39m

Executed 4 of 4 specs�[31m (1 FAILED)�[39m in 10 secs.
[17:01:05] I/local - Shutting down selenium standalone server.
[17:01:05] I/launcher - 0 instance(s) of WebDriver still running
[17:01:05] I/launcher - internet explorer11 #1 failed 1 test(s)
[17:01:05] I/launcher - overall: 1 failed spec(s)
[17:01:05] E/launcher - Process exited with error code 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] e2e: protractor
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] e2e script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Windows\system32\config\systemprofile\AppData\Roaming\npm-cache_logs\2018-01-17T16_01_05_909Z-debug.log`

The debug.log is:
0 info it worked if it ends with ok 1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe', 1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', 1 verbose cli 'run', 1 verbose cli 'e2e' ] 2 info using [email protected] 3 info using [email protected] 4 verbose run-script [ 'pree2e', 'e2e', 'poste2e' ] 5 info lifecycle [email protected]~pree2e: [email protected] 6 info lifecycle [email protected]~e2e: [email protected] 7 verbose lifecycle [email protected]~e2e: unsafe-perm in lifecycle true 8 verbose lifecycle [email protected]~e2e: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Jenkins\workspace\TestProject\TEST (trunk)\node_modules\.bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\nodejs\;C:\Program Files\TortoiseSVN\bin;C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps 9 verbose lifecycle [email protected]~e2e: CWD: C:\Jenkins\workspace\TestProject\TEST (trunk) 10 silly lifecycle [email protected]~e2e: Args: [ '/d /s /c', 'protractor' ] 11 silly lifecycle [email protected]~e2e: Returned: code: 1 signal: null 12 info lifecycle [email protected]~e2e: Failed to exec e2e script 13 verbose stack Error: [email protected] e2e: protractor13 verbose stack Exit status 1 13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16) 13 verbose stack at emitTwo (events.js:126:13) 13 verbose stack at EventEmitter.emit (events.js:214:7) 13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14) 13 verbose stack at emitTwo (events.js:126:13) 13 verbose stack at ChildProcess.emit (events.js:214:7) 13 verbose stack at maybeClose (internal/child_process.js:925:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) 14 verbose pkgid [email protected] 15 verbose cwd C:\Jenkins\workspace\TestProject\TEST (trunk) 16 verbose Windows_NT 10.0.14393 17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "e2e" 18 verbose node v8.9.4 19 verbose npm v5.6.0 20 error code ELIFECYCLE 21 error errno 1 22 error [email protected] e2e:protractor22 error Exit status 1 23 error Failed at the [email protected] e2e script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]

Bug report

  • Node Version: v8.9.4

  • Protractor Version: 5.2.2

  • Angular Version: 5.0.3

  • Browser(s): Internet Explorer 11 (Chrome and Firefox runs well)

  • Operating System and Version Windows Server 2016

  • protractor.conf.js
    `exports.config = {
    baseUrl: 'http://localhost:8080/',
    defaultWaitTimeout: 10000,
    localSeleniumStandaloneOpts: {

    jvmArgs: [
    '-Dwebdriver.ie.driver=./node_modules/protractor/node_modules/webdriver-manager/selenium/IEDriverServer3.8.0.exe',
    '-Dwebdriver.chrome.driver=./node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.35.exe',
    '-Dwebdriver.gecko.driver=./node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.19.1.exe'],
    },

    specs: [
    'src/app/app.component.e2e-spec.js',
    ],
    exclude: [],

    framework: 'jasmine2',

    allScriptsTimeout: 1000,

    jasmineNodeOpts: {
    showTiming: true,
    showColors: true,
    isVerbose: true,
    includeStackTrace: true,
    defaultTimeoutInterval: 400000
    },
    directConnect: false, // IE doesn't support directConnect

    multiCapabilities: [
    {
    browserName: 'chrome',
    javascriptEnabled: true,
    },
    {
    browserName: 'firefox',
    javascriptEnabled: true,
    },
    /* {
    browserName: 'internet explorer',
    version: '11',
    javascriptEnabled: true,
    }, */
    ],

    onPrepare: function () {
    var SpecReporter = require('jasmine-spec-reporter').SpecReporter;
    jasmine.getEnv().addReporter(new SpecReporter({ displayStacktrace: false }));

    browser.ignoreSynchronization = true;
    browser.driver.manage().window().setSize(1280, 1024); // Jenkins slave needs this setting!
    },

    /**

    • Angular 2 configuration
    • useAllAngular2AppRoots: tells Protractor to wait for any angular2 apps on the page instead of just the one matching
    • rootEl

    */
    useAllAngular2AppRoots: true
    };
    `

I already tried to fix the issue with the hints from:
https://stackoverflow.com/questions/32912909/problems-running-protractor-on-a-windows-jenkins-slave-node

Is it possible, that this issue relates to:
#841

@wOOx92 wOOx92 changed the title Generic "JavaScript error" when trying to run Protractor with Internet Explorer 11 on a Jenkins Windows Node Generic "JavaScript error" when trying to run Protractor with Internet Explorer 11 on a Jenkins Slave (Windows Server 2016) Jan 18, 2018
@wOOx92
Copy link
Author

wOOx92 commented Jan 18, 2018

The IE on the Jenkins Slave has the following settings:
http://elgalu.github.io/2014/run-protractor-against-internet-explorer-vm/

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

No branches or pull requests

1 participant