"UnsupportedOperationError: sendKeysToActiveElement" error when running 'keyDown(protractor.Key.CONTROL)'
See original GitHub issueHi 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
andChrome 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:
- Created 2 years ago
- Comments:8
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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…
Thanks anyway👍 @StanislavKharchenko