protractor
protractor copied to clipboard
Protractor.Key.Enter is not working in ChromeDriver v75.0.3770.8
Hi,
Hope someone can help me looking into this issue. I updated my chromedriver to the latest version i.e. v75.0.3770.8, my regression tests started failing since then.
See the error message below
Failed: sendKeysToActiveElement
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: '***', ip: '172.*.*.*', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_201'
Driver info: driver.version: unknown
I usually use the command below to to perform RETURN(ENTER) on keyboard. browser.actions().sendKeys(protractor.Key.ENTER).perform();
I reverted back to chrome v74.0.3729.6 and it's all working fine
Thanks
Bug report
- Node Version: ``10.15.2
- Protractor Version: ``5.4.2
- Angular Version: ``
- Browser(s): ``Chrome
- Operating System and Version `` Windows10
- Your protractor configuration file
var PrettyReporter = require('../Dependencies/protractor-plugins/protractor-reporter-2').Reporter;
var env = require('../Scripts/Common/rigSelection.json');
var log4js = require('log4js');
var date = require('../Scripts/Common/UTC_DateFunctions.js')
var JasmineReporters = require('jasmine-reporters');
var UTC_DateFunctions_currentDate = date.get_Current_Date();
var UTC_DateFunctions_currentTime = date.currentTimeIncludingSeconds();
var currentTime_And_Date = UTC_DateFunctions_currentDate + '_' + UTC_DateFunctions_currentTime;
exports.config = {
framework: 'jasmine',
seleniumAddress: 'http://localhost:4444/wd/hub',
rootElement: '.ng-app',
suites: {
Commands: './UTC/Verify_Command.js',
},
jasmineNodeOpts: {
showColours: true,
includeStackTrace: true,
defaultTimeoutInterval: 240000
},
beforeLaunch: function () {
var currentTime_And_Date_log = UTC_DateFunctions_currentDate + '_' + UTC_DateFunctions_currentTime + '.log';
var fileLocation = '../logs/';
log4js.configure({
appenders: {
fileLog: { type: 'file', filename: fileLocation + currentTime_And_Date_log },
console: { type: 'log4js-protractor-appender' },
},
categories: {
file: { appenders: ['fileLog'], level: 'debug' },
another: { appenders: ['console'], level: 'debug' },
default: { appenders: ['console', 'fileLog'], level: 'trace' }
}
});
},
onPrepare: function () {
browser.manage().timeouts().implicitlyWait(20000);
browser.manage().window().maximize();
console.log('************Setting all the infrastructure to run the tests****************');
browser.ignoreSynchronization = false;
browser.get(env.rig.UTC);
browser.logger = log4js.getLogger('protractorLog4js');
var ReportFileLocation = '../Reports/TestID_' + browser.params.env.testactivityId;
var prettyReporter = new PrettyReporter({
path: ReportFileLocation,
screenshotOnPassed: false,
project: browser.params.env.project,
rigURL: browser.params.env.rigURL
});
browser.params.prettyReporter = prettyReporter;
jasmine.getEnv().addReporter(prettyReporter);
},
capabilities: {
browserName: 'chrome',
},
baseUrl: '',
params: {
env: {
rig: 'default',
tenant: 'default',
filter: 'NO',
testactivityId: currentTime_And_Date,
rigUser: '',
rigPass: '',
project: 'UTC',
module: '',
moduleVersion: '',
rwwDataFile: '',
alertpath: '',
rigURL: 'https://localhost/utc'
}
}
};
- Output from running the test
Verify test commands - Verify a test command
Message:
Failed: sendKeysToActiveElement
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: '***', ip: '172.*.*.*', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_201'
Driver info: driver.version: unknown
Stack:
UnsupportedOperationError: sendKeysToActiveElement
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: '***', ip: '172.*.*.*', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_201'
Driver info: driver.version: unknown
at Object.checkLegacyResponse (C:\Users\user***\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:546:15)
at parseHttpResponse (C:\Users\user***\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:509:13)
at doSend.then.response (C:\Users\user***\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:441:30)
at process._tickCallback (internal/process/next_tick.js:68:7)
From: Task: sendKeys
at thenableWebDriverProxy.schedule (C:\Users\user***\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:807:17)
at actions.map.action (C:\Users\user***\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\actions.js:124:23)
at Array.map (<anonymous>)
at C:\Users\user***\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\actions.js:123:29
at TaskQueue.execute_ (C:\Users\user***\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:3084:14)
at TaskQueue.executeNext_ (C:\Users\user***\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:3067:27)
at asyncRun (C:\Users\user***\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2927:27)
at C:\Users\user***\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:668:7
at process._tickCallback (internal/process/next_tick.js:68:7)
From: Task: ActionSequence.perform
at ActionSequence.perform (C:\Users\user***\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\actions.js:122:33)
at UserContext.<anonymous> (C:\workspace\Selenium Scripts\Scripts\UTC\Verify_LSTS_Command.js:36:58)
at C:\Users\user***\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd2\index.js:112:25
at new ManagedPromise (C:\Users\user***\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:1077:7)
at ControlFlow.promise (C:\Users\user***\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2505:12)
at schedulerExecute (C:\Users\user***\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd2\index.js:95:18)
at TaskQueue.execute_ (C:\Users\user***\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:3084:14)
at TaskQueue.executeNext_ (C:\Users\user***\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:3067:27)
at asyncRun (C:\Users\user***\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2974:25)
at C:\Users\user***\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:668:7
From: Task: Run it("Verify LSTS command on a junction") in control flow
at UserContext.<anonymous> (C:\Users\user***\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd2\index.js:94:19)
at C:\Users\user***\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd2\index.js:64:48
at ControlFlow.emit (C:\Users\user***\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\events.js:62:21)
at ControlFlow.shutdown_ (C:\Users\user***\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2674:10)
at shutdownTask_.MicroTask (C:\Users\user***\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2599:53)
From asynchronous test:
Error
at Suite.<anonymous> (C:\workspace\Selenium Scripts\Scripts\UTC\Verify_LSTS_Command.js:30:5)
at Object.<anonymous> (C:\workspace\Selenium Scripts\Scripts\UTC\Verify_LSTS_Command.js:6:1)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
1 spec, 1 failure
Finished in 71.593 seconds
My understanding is that call is part of this rewrite.
https://chromedriver.storage.googleapis.com/76.0.3809.12/notes.txt
----------ChromeDriver 76.0.3809.12 (2019-06-07)---------- Supports Chrome version 76 Resolved issue 1897: Implement Actions API [Pri-1]
https://bugs.chromium.org/p/chromedriver/issues/detail?id=1897
My understanding is that call is part of this rewrite.
https://chromedriver.storage.googleapis.com/76.0.3809.12/notes.txt
----------ChromeDriver 76.0.3809.12 (2019-06-07)---------- Supports Chrome version 76 Resolved issue 1897: Implement Actions API [Pri-1]
https://bugs.chromium.org/p/chromedriver/issues/detail?id=1897
Hi Joseph,
Tested in Chrome Version v76.0.3809.100 and Chromedriver v76.0.3809.12. It still complaining about UnsupportedOperationError. Please see the stracktrace below
Failed: sendKeysToActiveElement Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53' System info: host: '****', ip: '10.0.75.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_201' Driver info: driver.version: unknown Stack: UnsupportedOperationError: sendKeysToActiveElement Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53' System info: host: '****', ip: '10.0.*.*', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_201' Driver info: driver.version: unknown at Object.checkLegacyResponse (C:\Users\kiran333\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:546:15) at parseHttpResponse (C:\Users\kiran333\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:509:13) at doSend.then.response (C:\Users\kiran333\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:441:30) at process._tickCallback (internal/process/next_tick.js:68:7) From: Task: sendKeys at thenableWebDriverProxy.schedule (C:\Users\kiran333\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:807:17) at actions.map.action (C:\Users\kiran333\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\actions.js:124:23) at Array.map (<anonymous>) at C:\Users\kiran333\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\actions.js:123:29 at TaskQueue.execute_ (C:\Users\kiran333\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:3084:14) at TaskQueue.executeNext_ (C:\Users\kiran333\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:3067:27) at asyncRun (C:\Users\kiran333\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2927:27) at C:\Users\kiran333\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:668:7 at process._tickCallback (internal/process/next_tick.js:68:7) From: Task: ActionSequence.perform at ActionSequence.perform (C:\Users\kiran333\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\actions.js:122:33) at UserContext.<anonymous> (C:\workspace\Selenium Scripts\Scripts\UTC\Verify_LSTS_Command.js:36:58) at C:\Users\kiran333\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd2\index.js:112:25 at new ManagedPromise (C:\Users\kiran333\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:1077:7) at ControlFlow.promise (C:\Users\kiran333\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2505:12) at schedulerExecute (C:\Users\kiran333\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd2\index.js:95:18) at TaskQueue.execute_ (C:\Users\kiran333\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:3084:14) at TaskQueue.executeNext_ (C:\Users\kiran333\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:3067:27) at asyncRun (C:\Users\kiran333\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2974:25) at C:\Users\kiran333\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:668:7 From: Task: Run it("Verify LSTS command on a junction") in control flow at UserContext.<anonymous> (C:\Users\kiran333\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd2\index.js:94:19) at C:\Users\kiran333\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd2\index.js:64:48 at ControlFlow.emit (C:\Users\kiran333\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\events.js:62:21) at ControlFlow.shutdown_ (C:\Users\kiran333\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2674:10) at shutdownTask_.MicroTask (C:\Users\kiran333\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2599:53) From asynchronous test:
It seems bug fixed in chromedriver 77.0.3865.10:
Resolved issue 2975: Webdriver Actions for keys (CONTROL, SHIFT etc..) not working in ChromeDriver 75.0.3770.8 [Pri-2]
Resolved issue 2981: Chromedriver in W3C mode loses mouse state between Actions API calls [Pri-2]
I'm also running into this issue on Chrome 76 for browser.actions().sendKeys(protractor.Key.TAB).perform(); and all keystrokes. I hope this is indeed fixed in Chrome 77. From what I see v.77 will be released September 10, 2019.
I use workaround below. Download Chromium 74 version instructions. In protractor.conf.js in capabilities specify Chromium binary:
...
{
browserName: 'chrome',
maxInstances: 4,
shardTestFiles: true,
chromeOptions: {
...
//your path to Chromium
binary: '/Applications/Chromium.app/Contents/MacOS/Chromium',
args: ["--headless", "--disable-gpu", "--window-size=1024,768"]
}
}
...
that's all. My tests work again! BTW it's time to use browserless decisions like that: https://hub.docker.com/r/browserless/chrome/#docker
I use workaround below. Download Chromium 74 version instructions. In protractor.conf.js in capabilities specify Chromium binary:
... { browserName: 'chrome', maxInstances: 4, shardTestFiles: true, chromeOptions: { ... //your path to Chromium binary: '/Applications/Chromium.app/Contents/MacOS/Chromium', args: ["--headless", "--disable-gpu", "--window-size=1024,768"] } } ...
that's all. My tests work again! BTW it's time to use browserless decisions like that: https://hub.docker.com/r/browserless/chrome/#docker
Hi Paragraff,
Thats's what I did. I downgraded my chrome version to 74 and it started working again.
Hi @kiran333 , @jmutidjo
enabling the below capability enables chrome 74+ to use legacy API. Please try it works.
'goog:chromeOptions': { w3c: false }
Thanks !
Appreciate the help @Harsha509
Hi everyone, I am using chrome 78, still getting this error: "Failed: sendKeysToActiveElement"
Is there any documentation for Errors on Protractor because I could not find any in their official website. Guys, would you please help me with this...
Hi All, I have been getting this error since v75 of chromedriver. Could someone please look into this
Hi everyone, I am using chrome 78, still getting this error: "Failed: sendKeysToActiveElement"
Is there any documentation for Errors on Protractor because I could not find any in their official website. Guys, would you please help me with this...
Hi elnazkhorsand, There is a quick workaround. Add below lines to your capabilities in config file.
'goog:chromeOptions': { w3c: false }
Hi @kiran333 ,
Still it does not work. Did you fix your problem with this?
Hi everyone,
My conclusion on this issue: I have searched a lot and asked the experts, unfortunately this problem still exists and we have to use the older versions and wait for their release.
Yeah.It worked for me, I am still using chrome v75 and chrome driver v75 though.
Sent from Yahoo Mail for iPhone
On Friday, October 4, 2019, 10:20, elnazkhorsand [email protected] wrote:
Hi everyone,
My conclusion on this issue: I have searched a lot and asked the experts, unfortunately this problem still exists and we have to use the older versions and wait for their release.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Hey @kiran333 ,
I am using v78 and I wrote the code in my configuration file like this:
`exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub', specs: ['protocommerce.js'], capabilities:{'browserName':'chrome', 'goog:chromeOptions': { w3c: false }
}
};`
Is yours like this? Thanks for your time in advanced.
Hey, I just tried this on chrome 77 and chromedriver 77. It worked. Your config seems fine to me. Thanks
Sent from Yahoo Mail for iPhone
On Friday, October 4, 2019, 11:26, elnazkhorsand [email protected] wrote:
Hey @kiran333 ,
I am using v78 and I wrote the code in my configuration file like this:
`exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub', specs: ['protocommerce.js'], capabilities:{'browserName':'chrome', 'goog:chromeOptions': { w3c: false } }
};`
Is yours like this? Thanks for your time in advanced.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Getting error UnsupportedOperationError: sendKeysToActiveElement in Chrome 78 version
config.multiCapabilities.push({ 'browserName': 'chrome', 'goog:chromeOptions': { 'args': ['no-sandbox'], 'w3c': false } }); Please suggest how to resolve this issue
Hello, Have there been any updates to solve this? While w3c: false did fix it, w3c: false now causes .getAttribute() to fail. Naturally .getAttribute() failing has a far larger impact. Thanks