Protractor: `nativeEvents: false` on IE 11 seems not to work well with Protractor 3.2.1

Created on 24 Mar 2016  路  25Comments  路  Source: angular/protractor

When I run tests in IE 11 using selenium, some click() doesn't work.
This is an existing issue.
http://stackoverflow.com/questions/32342797/protractor-click-not-working-in-ie-but-works-in-chrome
http://sqa.stackexchange.com/questions/9496/webdriver-clicking-button-issue-in-ie-11/13061

As it's mentioned in answers above, setting nativeEvents: false worked for me to solve the clicking problem with Protractor 3.1.1.
However it doesn't work with Protractor 3.2.1.

Any ideas?

  • Node Version: v4.3.1
  • Protractor Version: 3.2.1
  • protractor configuration file
capabilities: {
  'browserName': 'internet explorer',
  'version': '11',
  'selenium-version': '2.52.0',
  'name': 'E2E Tests on IE in WINDOWS',
  'nativeEvents': false
}
  • selenium (Sauce Labs)
Browser: iexplore
Browser version: 11.0.9600.16428.
OS: Windows 2008
Selenium version: 2.52.0
IE external bug filed external bug needs to be filed

Most helpful comment

Quick update on this. It appears that this is an issue when we upgraded selenium-webdriver 2.52.0 (29627f42bb7404f66e3a76ba3cbd85256b408fb6). This still is an external bug with selenium. I'll take a look at how selenium is handling the api we are using.

If you require testing with internet explorer with nativeEvents, I would suggest staying on 3.1.1 for now.

All 25 comments

Do you still have this problem if you update? We had a hotfix to 3.2.2

It still fails with protractor 3.2.2

None of the properties specified in capabilities will be propagated to IEDriver. WebDriver session will be initialized with all default flags. Last version that worked fine for me is 3.1.1

DEBUG - Running with --troubleshoot
DEBUG - Protractor version: 3.2.2
DEBUG - Your base url for tests is ...
Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver
DEBUG - WebDriver session successfully started with capabilities Capabilities {
'javascriptEnabled' => true,
'elementScrollBehavior' => 0,
'ignoreZoomSetting' => false,
'enablePersistentHover' => true,
'ie.ensureCleanSession' => false,
'browserName' => 'internet explorer',
'ie.enableFullPageScreenshot' => true,
'webdriver.remote.sessionid' => '915eb246-9407-40ec-aee2-2bf588ab1d55',
'version' => '11',
'ignoreProtectedModeSettings' => false,
'requireWindowFocus' => false,
'initialBrowserUrl' => 'http://localhost:36593/',
'nativeEvents' => true,
'proxy' => { proxyType: 'system' },
'browserAttachTimeout' => 0,
'ie.browserCommandLineSwitches' => '',
'takesScreenshot' => true,
'platform' => 'WINDOWS',
'enableElementCacheCleanup' => true,
'unexpectedAlertBehaviour' => 'dismiss',
'ie.fileUploadDialogTimeout' => 3000,
'ie.forceShellWindowsApi' => false,
'pageLoadStrategy' => 'normal',
'cssSelectorsEnabled' => true,
'ie.forceCreateProcessApi' => false }

@miyukiw Is there a way to delete the selenium folder (where webdriver is saving the files) or run webdriver-manager clean? The file type *.exe was not appended to the internet explorer binary and running just update will not fix it. So:

webdriver-manager clean
webdriver-manager update

We will have a better check so this does not happen in the future.

@cnishina I'm using Sauce Labs as remote Selenium Server for the test in IE11.
How can I do for that?

Here is the debug log.
with 3.1.1, nativeEvents is FALSE as I expected, but TRUE with 3.2.2

  • capability configuration
    {
      'browserName': 'internet explorer',
      'version': '11',
      'selenium-version': '2.53.0',
      'name': 'E2E Tests on ie in WINDOWS',
      'nativeEvents': false, 
      'tunnel-identifier' : process.env.TRAVIS_JOB_NUMBER
    }
  • 3.1.1
DEBUG - Running with --troubleshoot
DEBUG - Protractor version: 3.1.1
DEBUG - Your base url for tests is http://app-dev.lvh.me:9000
Using SauceLabs selenium server at http://ondemand.saucelabs.com:80/wd/hub
[launcher] Running 1 instances of WebDriver
DEBUG - WebDriver session successfully started with capabilities { caps_: 
   { takesScreenshot: true,
     version: '11',
     unexpectedAlertBehaviour: 'dismiss',
     'ie.browserCommandLineSwitches': '',
     browserAttachTimeout: 0,
     'ie.ensureCleanSession': false,
     ignoreProtectedModeSettings: false,
     platform: 'WINDOWS',
     'webdriver.remote.sessionid': 'a408f08bf44e454bb74087963e6205b3',
     ignoreZoomSetting: false,
     nativeEvents: false,
     handlesAlerts: true,
     javascriptEnabled: true,
     requireWindowFocus: false,
     browserName: 'internet explorer',
     hasMetadata: true,
     initialBrowserUrl: 'about:blank',
     enableElementCacheCleanup: true,
     cssSelectorsEnabled: true,
     'ie.usePerProcessProxy': false,
     elementScrollBehavior: 0,
     enablePersistentHover: false,
     pageLoadStrategy: 'normal',
     'ie.forceCreateProcessApi': false } }
  • 3.2.2
DEBUG - Running with --troubleshoot
DEBUG - Protractor version: 3.2.2
DEBUG - Your base url for tests is http://app-dev.lvh.me:9000
Using SauceLabs selenium server at http://ondemand.saucelabs.com:80/wd/hub
[launcher] Running 1 instances of WebDriver
DEBUG - WebDriver session successfully started with capabilities Capabilities {
  'takesScreenshot' => true,
  'version' => '11',
  'unexpectedAlertBehaviour' => 'dismiss',
  'ie.browserCommandLineSwitches' => '',
  'browserAttachTimeout' => 0,
  'ie.ensureCleanSession' => false,
  'ignoreProtectedModeSettings' => false,
  'platform' => 'WINDOWS',
  'webdriver.remote.sessionid' => 'e0457607e6d648ccb07509f5457a3f7d',
  'ignoreZoomSetting' => false,
  'nativeEvents' => true,
  'handlesAlerts' => true,
  'javascriptEnabled' => true,
  'requireWindowFocus' => false,
  'browserName' => 'internet explorer',
  'hasMetadata' => true,
  'initialBrowserUrl' => 'about:blank',
  'enableElementCacheCleanup' => true,
  'cssSelectorsEnabled' => true,
  'ie.usePerProcessProxy' => false,
  'elementScrollBehavior' => 0,
  'enablePersistentHover' => true,
  'pageLoadStrategy' => 'normal',
  'ie.forceCreateProcessApi' => false }

It appears to be an external issue. "Interestingly, if d.setCapability("nativeEvents", false) is uncommented, everything works as expected."

https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/4403

How it could be an external issue if 3.1.1 works fine with exactly the same version of Selenium? Please note that other flags are not reflecting the correct values in version 3.2.2. For example 'enablePersistentHover' is always 'true' and no way to set it to 'false'.

I'm also against that this is an external issue.
The problem is not nativeEvents itself but protractor 3.2.2 doesn't reflect Capabilities configuration to webDriver.

So capabilities is of type any and is being passed unchanged to the driverprovider. Protractor does not change your capabilities.

https://github.com/angular/protractor/blob/master/lib/configParser.ts#L22
https://github.com/angular/protractor/blob/master/lib/driverProviders/driverProvider.js#L38

The big difference between 3.1.1 and 3.2.2 for webdriver-manager:

  • 3.1.1: downloads IEDriver 2.51.0, selenium standalone 2.51.0, and chromedriver 2.20
  • 3.2.2: downloads IEDriver 2.52.0, selenium standalone 2.52.0 and chromedriver 2.21

If it was previously working in 3.1.1 and you wish to continue to use those binaries, you can:

webdriver-manager update --versions.ie=2.51.0 --versions.chrome=2.20 --versions.standalone=2.51.0
webdriver-manager start --ie --versions.ie=2.51.0 --versions.chrome=2.20 --versions.standalone=2.51.0

I'm not even using webdriver-manager. Selenium standalone driver v. 2.52.0 was used in both cases. So the only change was performed is the update to protractor 3.2.2. When I figured out that capabilities configuration is not working in 3.2.2 I reverted back to 3.1.1 and everything is working again with Selenium 2.52.0.

@alexinna So you are using version 2.52.0 of selenium standalone server and you are launching it with an iedriver. What version of iedriver are you using?

I'm using IEDriverServer v. 2.52.2.

Also I see the following change between 3.1.1 and 3.2.0
-var ConfigParser = require('./configParser'),
+var ConfigParser = require('./configParser').default
Can this change cause the issue?

No, this is a change in typescript export default vs export in the ConfigParser.ts file. It is a typescript import ConfigParser from './configParser'; vs import {ConfigParser} from './configParser';

I was pointing out to lib/launcher.js change and not ConfigParser.ts

@alexinna Yes, I understand. The require('./configParser').default is how you bring in export default class ConfigParser. This is not the issue.

Below is my IE capability configuration:
capabilities: { 'browserName': 'internet explorer', 'platform': 'WINDOWS', 'version': '11', 'enablePersistentHover': false, 'proxy': { 'proxyType': 'system' } }
Result:
DEBUG - WebDriver session successfully started with capabilities Capabilities {
'javascriptEnabled' => true,
'elementScrollBehavior' => 0,
'ignoreZoomSetting' => false,
'enablePersistentHover' => true,
'ie.ensureCleanSession' => false,
'browserName' => 'internet explorer',
'ie.enableFullPageScreenshot' => true,
'webdriver.remote.sessionid' => '915eb246-9407-40ec-aee2-2bf588ab1d55',
'version' => '11',
'ignoreProtectedModeSettings' => false,
'requireWindowFocus' => false,
'initialBrowserUrl' => 'http://localhost:36593/',
'nativeEvents' => true,
'proxy' => { proxyType: 'system' },
'browserAttachTimeout' => 0,
'ie.browserCommandLineSwitches' => '',
'takesScreenshot' => true,
'platform' => 'WINDOWS',
'enableElementCacheCleanup' => true,
'unexpectedAlertBehaviour' => 'dismiss',
'ie.fileUploadDialogTimeout' => 3000,
'ie.forceShellWindowsApi' => false,
'pageLoadStrategy' => 'normal',
'cssSelectorsEnabled' => true,
'ie.forceCreateProcessApi' => false }

As you can see string value for proxyType was passed correctly but boolean value for enablePersistentHover property is still 'true'.

I'm using Selenium 2.53.0 on SauceLabs, and the result is exactly the same as what @alexinna said.

When I figured out that capabilities configuration is not working in 3.2.2 I reverted back to 3.1.1 and everything is working again with Selenium 2.52.0.

  • capability configuration
    {
      'browserName': 'internet explorer',
      'version': '11',
      'selenium-version': '2.53.0',
      'name': 'E2E Tests via TRAVIS on ie in WINDOWS',
      'nativeEvents': false, 
      'tunnel-identifier' : process.env.TRAVIS_JOB_NUMBER
    }

Here is the Metadata "Base config" from SauceLabs after running the test with same configuration above.

  • with protractor 3.1.1
"count": 1,
"name": "E2E Tests via TRAVIS on ie in WINDOWS",
"tunnel-identifier": "1442.1",
"selenium-version": "2.53.0",
"browserName": "internet explorer",
"version": "11",
"build": "1442",
"nativeEvents": false
  • with protractor 3.2.2
"count": 1,
"name": "E2E Tests via TRAVIS on ie in WINDOWS",
"tunnel-identifier": "1430.1",
"selenium-version": "2.53.0",
"browserName": "internet explorer",
"version": "11",
"build": "1430"

To see the result on SauceLabs, among my capabilities configuration 'selenium-version': '2.53.0' seems to be reflected correctly but nativeEvents is missing in protractor 3.2.2

More investigation that this is not a protractor issue:

using selenium standalone server 2.52.0. Log from webdriver-manager:

Started InternetExplorerDriver server (32-bit)
2.52.0.0
Listening on port 40793
Only local connections are allowed
16:47:55.180 INFO - Done: [new session: Capabilities [{nativeEvents=false, elementScrollBehavior=1, count=1, browserName=internet explorer}]]
16:47:55.207 INFO - Executing: [set script timeout: 11000])
16:47:55.223 INFO - Done: [set script timeout: 11000]
16:47:55.315 INFO - Executing: [get: about:blank])
16:47:55.541 INFO - Done: [get: about:blank]
16:47:55.555 INFO - Executing: [execute script: window.name = "NG_ENABLE_DEBUG_INFO!NG_DEFER_BOOTSTRAP!" + window.name;window.location.replace("http://angularjs.org/");, []])
16:47:55.621 INFO - Done: [execute script: window.name = "NG_ENABLE_DEBUG_INFO!NG_DEFER_BOOTSTRAP!" + window.name;window.location.replace("http://angularjs.org/");, []]
16:47:55.640 INFO - Executing: [execute script: return window.location.href;, []])
16:47:55.958 INFO - Done: [execute script: return window.location.href;, []]
16:47:55.967 INFO - Executing: [execute async script: try { return (function (attempts, asyncCallback) {

conf.js

exports.config = {
  seleniumAddress: 'http://localhost:4444/wd/hub',
  capabilities: {
    browserName: 'internet explorer',
    elementScrollBehavior: 1,
    nativeEvents: false
  },
  framework: 'jasmine',
  baseUrl: 'http://angularjs.org',
  specs: [
    'capabilities_spec.js'
  ],
  jasmineNodeOpts: {
    defaultTimeoutInterval: 30000
  }
}

capabilities_spec.js

describe('specs loaded to selenium', function() {
  it('should have the right capabilities', function() {
    browser.get(browser.baseUrl);
    browser.getCapabilities().then(function(capabilities) {
      console.log(capabilities);
    });
  });
});

console logs:

C:\Users\test\src\protractor-examples\protractor\capabilities_spec>protractor conf.js
Using the selenium server at http://localhost:4444/wd/hub
[launcher] Running 1 instances of WebDriver
Started
Capabilities {
  'browserAttachTimeout' => 0,
  'enablePersistentHover' => true,
  'ie.forceCreateProcessApi' => false,
  'pageLoadStrategy' => 'normal',
  'ie.usePerProcessProxy' => false,
  'ignoreZoomSetting' => false,
  'handlesAlerts' => true,
  'version' => '11',
  'platform' => 'WINDOWS',
  'nativeEvents' => true,
  'ie.ensureCleanSession' => false,
  'elementScrollBehavior' => 0,
  'ie.browserCommandLineSwitches' => '',
  'webdriver.remote.sessionid' => '60a3f509-037a-46ea-9328-a01ea8c37c9d',
  'requireWindowFocus' => false,
  'browserName' => 'internet explorer',
  'initialBrowserUrl' => 'http://localhost:2479/',
  'takesScreenshot' => true,
  'javascriptEnabled' => true,
  'ignoreProtectedModeSettings' => false,
  'enableElementCacheCleanup' => true,
  'cssSelectorsEnabled' => true,
  'unexpectedAlertBehaviour' => 'dismiss' }
.


1 spec, 0 failures
Finished in 1.798 seconds
[launcher] 0 instance(s) of WebDriver still running
[launcher] internet explorer #01 passed

elementScrollBehavior default is 0 and is setting to 1... this is set via capabilities.
nativeEvents default is true, selenium standalone server shows we are setting nativeEvents to false; however, getting the capabilities from the webdriver shows that it is set to true.

Trying out this behavior with versions 2.48.0 and 2.51.0 (for both IEDriverServer and standalone selenium jar file) has the same results.

Trying out this behavior with versions 2.48.0 and 2.51.0 (for both IEDriverServer and standalone selenium jar file) has the same results.

I tried protractor 3.2.2 with 2.48.0, 2.52.0 and 2.53.0. None of them worked correctly.
3.1.1 works fine with all of the above. And web log debug messages reflect the values specified in capabilities.

My understanding the case you described is with 3.2.2. Did you have a chance to try with 3.1.1?

Quick update on this. It appears that this is an issue when we upgraded selenium-webdriver 2.52.0 (29627f42bb7404f66e3a76ba3cbd85256b408fb6). This still is an external bug with selenium. I'll take a look at how selenium is handling the api we are using.

If you require testing with internet explorer with nativeEvents, I would suggest staying on 3.1.1 for now.

Going down the stack with the following capabilities:

capabilities: {'browserName': 'internetExplorer', 'elementScrollBehavior': 1, 'nativeEvents': 'false'}

  • driverProvider.getNewDriver we pass selenium webdriver the correct capabilities
  • webdriver creates a session by acquiring a session. While acquiring a session, it converts the capabilities with toWireValue which calls convertValue.
  • in convertValue:
if (typeof value[Symbols.serialize] === 'function') {
    return toWireValue(value[Symbols.serialize]());
  }

value[Symbols.serialize]() returns {'browserName': 'internetExplorer', 'elementScrollBehavior': 1, 'count': 1}

If you require testing with internet explorer with nativeEvents, I would suggest staying on 3.1.1 for now.

This is exactly what we are doing.
Thanks a lot for your help.

Thank you for investigating. @cnishina

Update - this is fixed in selenium-webdriver at master but not at the latest release. When a new version is out we will update to it.

Was this page helpful?
0 / 5 - 0 ratings