Protractor: Browser actions not working with chromedriver 75.0.3770.8

Created on 14 Jun 2019  路  6Comments  路  Source: angular/protractor

Versions:

  • protractor - 5.4.2
  • Chrome - 75.0.3770.90-1
  • chromedriver - 75.0.3770.8

Problem:

My team relies heavily on browser actions such as:
protractor.browser.actions().sendKeys(protractor.Key.ARROW_DOWN).perform();

We experienced no problems until chromedriver 75.0.3770.8. Now the ARROW_DOWN action above throws the following error:

[chrome #01-5]      Uncaught UnsupportedOperationError: sendKeysToActiveElement
[chrome #01-5] Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
[chrome #01-5] System info: host: 'ip-10-50-2-202.ec2.internal', ip: '10.50.2.202', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-957.5.1.el7.x86_64', java.version: '1.8.0_201'
[chrome #01-5] Driver info: driver.version: unknown
[chrome #01-5]       at Object.checkLegacyResponse (node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:546:15)
[chrome #01-5]       at parseHttpResponse (node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:509:13)
[chrome #01-5]       at doSend.then.response (node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:441:30)
[chrome #01-5]       at process._tickDomainCallback (internal/process/next_tick.js:135:7)
[chrome #01-5]   From: Task: sendKeys
[chrome #01-5]       at thenableWebDriverProxy.schedule (node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:807:17)
[chrome #01-5]       at actions.map.action (node_modules/protractor/node_modules/selenium-webdriver/lib/actions.js:124:23)
[chrome #01-5]       at Array.map (native)
[chrome #01-5]       at node_modules/protractor/node_modules/selenium-webdriver/lib/actions.js:123:29
[chrome #01-5]       at TaskQueue.execute_ (node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:3084:14)
[chrome #01-5]       at TaskQueue.executeNext_ (node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:3067:27)
[chrome #01-5]       at asyncRun (node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2974:25)
[chrome #01-5]       at node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:668:7
[chrome #01-5]       at process._tickDomainCallback (internal/process/next_tick.js:135:7)

Our temporary fix is revert chromedriver back to version 74.0.3729.6 in our package.json:

node_modules/protractor/bin/webdriver-manager update --versions.chrome 74.0.3729.6

This prior version successfully handles the key events and our suite is passing again.

Most helpful comment

@bstiles13

Please give a try

capabilities: {
'goog:chromeOptions': {
w3c: false
}
}

All 6 comments

This happens because from chromedriver 75.0.3770.8 the w3c is enabled by default. You have to either create a workaround or explicitly set w3c to false.
https://chromedriver.storage.googleapis.com/75.0.3770.90/notes.txt

This happens because from chromedriver 75.0.3770.8 the w3c is enabled by default. You have to either create a workaround or explicitly set w3c to false.
https://chromedriver.storage.googleapis.com/75.0.3770.90/notes.txt

I have tried to disable w3c with no luck. The same error persists.

Attempt 1 (script):
npm test target/config/sample.config.js -- --chromeOptions.w3c=false

Attempt 2 (config):

export let config: Config = {
    capabilities: {
        'chromeOptions': {
            args: ['w3c=false']
        }
    }
};

Attempt 3 (config):

export let config: Config = {
    capabilities: {
        'chromeOptions': {
            args: ['--w3c=false']
        }
    }
};

Attempt 4 (config):

export let config: Config = {
    capabilities: {
        'chromeOptions': {
            w3c: false
        }
    }
};

@bstiles13

Please give a try

capabilities: {
'goog:chromeOptions': {
w3c: false
}
}

@vsravuri

It worked. Thank you!

@bstiles13 could you close this issue?

For anyone doing this in Java or Scala, here's the equivalent code snippet:

val options = new ChromeOptions
options.setExperimentalOption("w3c", false)
Was this page helpful?
0 / 5 - 0 ratings

Related issues

vishalshivnath picture vishalshivnath  路  3Comments

jmcollin78 picture jmcollin78  路  3Comments

amedvedjev picture amedvedjev  路  3Comments

gamecheck80 picture gamecheck80  路  3Comments

codef0rmer picture codef0rmer  路  3Comments