question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"UnsupportedOperationError: sendKeysToActiveElement" error when running 'keyDown(protractor.Key.CONTROL)'

See original GitHub issue

Hi there!

I’ve been spent days trying to figure out how to correctly perform a ‘ctrl + click’ action in protractor tests, but I’m always getting error UnsupportedOperationError: sendKeysToActiveElement, From: Task: keyDown. Looks like keyDown(protractor.Key.CONTROL) is not supported with newer version browsers? I did some research online, latest post about perform ‘ctrl+click’ in protractor dates back to 2019, and none of the solutions there work for me…T T

I really appreciate any suggestion/help! thank you so much 😃

Bug report

  • Node Version: v10.22.0
  • Protractor Version: 7.0.0
  • Angular Version: ``
  • Browser(s): Firefox Version 90.0.818.46 and Chrome Version 90.0.4430.85
  • Operating System and Version Windows 10 pro 64bit
  • Your protractor configuration file
  • A relevant example test: I try to perform ‘ctrl+click’ action for rows in table by using following code browser.actions() .mouseMove(this.getRow(rowNumber).siteId) .keyDown(protractor.Key.CONTROL) .click() .keyUp(protractor.Key.CONTROL) .perform();
  • Output from running the test: Message: Failed: sendKeysToActiveElement Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53' System info: host: 'xxx2160', ip: 'xx.xx.xx.xx', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '16' 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: 'xxx2160', ip: 'xx.xx.xx.xx', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '16' Driver info: driver.version: unknown at Object.checkLegacyResponse (C:\Users\azao\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:546:15) at parseHttpResponse (C:\Users\azao\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:509:13) at doSend.then.response (C:\Users\azao\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: keyDown at thenableWebDriverProxy.schedule (C:\Users\azao\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:807:17) at actions.map.action (C:\Users\azao\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\actions.js:124:23) at Array.map (<anonymous>) at C:\Users\azao\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\actions.js:123:29 at TaskQueue.execute_ (C:\Users\azao\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:3084:14) at TaskQueue.executeNext_ (C:\Users\azao\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:3067:27) at asyncRun (C:\Users\azao\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2927:27) at C:\Users\azao\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
  • Steps to reproduce the bug
  • The URL you are running your tests against (if relevant): protractor protractor-test.conf.js

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8

github_iconTop GitHub Comments

2reactions
StanislavKharchenkocommented, Apr 26, 2021

It seems that Protractor doesn’t handle these browser events properly. I suggest to ask in stackoverflow, there more users from Protractor and native selenium-webdriver community. Unfortunately, Protractor maintainers in @angular team totally ignore any users issues and even ignore comments. They also decided to deprecate and neglect project after a year total ignoring…

0reactions
ariel0058commented, Apr 26, 2021

Thanks anyway👍 @StanislavKharchenko

Read more comments on GitHub >

github_iconTop Results From Across the Web

Always getting a "Failed: sendKeysToActiveElement" error ...
keyDown (protractor.Key.CONTROL) .click(await elem_2. ... I am getting the error as - UnsupportedOperationError: sendKeysToActiveElement ...
Read more >
I am getting the error UnhandledPromiseRejectionWarning ...
I used the below lines of code but i have been facing an issue. browser.actions().mouseMove(control).keyDown(protractor.Key.CONTROL).keyUp( ...
Read more >
angular/protractor - Gitter
I am using protractor to run e2e tests for my angular application and we made these ... These test cases will fail intermittently...
Read more >
Keyboard Events in Selenium Actions Class - Tools QA
Whichever META key (Eg CONTROL in the above use case) we press using the keyDown() method, it must be released using the keyUp()...
Read more >
webdriver.WebElement.prototype.sendKeys - Protractor
WebElement.prototype.sendKeys. Schedules a command to type a sequence on the DOM element represented by this instance. Modifier keys (SHIFT, CONTROL, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found