WebDriverException: unknown error: Cannot construct KeyEvent from non-typeable key

1,234 views
Skip to first unread message

Farid Ismailov

unread,
Feb 3, 2022, 1:36:35 AM2/3/22
to ChromeDriver Users
Hello everyone,

Today I found a big issue with my Selenium autotests using Chrome Webdriver.
When Chrome is launched on any keyboard layout that is not English - any sendKeys command throws an error "WebDriverException: unknown error: Cannot construct KeyEvent from non-typeable key"
When Chrome is launched on English keyboard layout - everything works fine.

The problem is that when I run lots of autotests in headless - it blocks any other work on my machine, since I can't switch keyboard layouts.

Here are my specs:
Caused by: org.openqa.selenium.WebDriverException: unknown error: Cannot construct KeyEvent from non-typeable key
  (Session info: chrome=98.0.4758.80)
Build info: version: '4.1.1', revision: 'e8fcc2cecf'
System info: host: 'CAB-WSM-0016015', ip: '192.168.1.30', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '12.2', java.version: '17'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [8b1b0985f7df799e6f75a6d49a329aeb, sendKeysToElement {id=9df8413d-3c91-4223-a7d4-14171e114c5b, value=[Ljava.lang.CharSequence;@7493d937}]
Capabilities {acceptInsecureCerts: true, browserName: chrome, browserVersion: 98.0.4758.80, chrome: {chromedriverVersion: 98.0.4758.48 (d869ab3eda606..., userDataDir: /var/folders/4g/mz1k_6_93vz...}, goog:chromeOptions: {debuggerAddress: localhost:53820}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: MAC, platformName: MAC, proxy: Proxy(), se:cdp: ws://localhost:53820/devtoo..., se:cdpVersion: 98.0.4758.80, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:virtualAuthenticators: true}
Element: [[ChromeDriver: chrome on MAC (8b1b0985f7df799e6f75a6d49a329aeb)] -> css selector: input[name='q']]

Mathias Bynens

unread,
Feb 3, 2022, 3:46:44 AM2/3/22
to Farid Ismailov, nec...@chromium.org, ChromeDriver Users

--
You received this message because you are subscribed to the Google Groups "ChromeDriver Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromedriver-us...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/chromedriver-users/49b90654-a565-416b-b862-e97ff4bfbfb3n%40googlegroups.com.

Guillaume CHAU

unread,
Feb 3, 2022, 4:36:01 AM2/3/22
to ChromeDriver Users
I see the exact same issue when my Linux computer keyboard layout is set to French (AZERTY). Switching to QWERTY (English US) solves it but this is only a workaround as my physical keyboard is AZERTY.

Farid Ismailov

unread,
Feb 3, 2022, 4:41:38 AM2/3/22
to ChromeDriver Users
Nope. Not at all. I am sending regular english letters.
They are just not being sent if the system was switched to non-english keyboard layout.

On version 97 it switched to EN keyboard layout automatically.

четверг, 3 февраля 2022 г. в 11:46:44 UTC+3, Mathias Bynens:

Sait Ishmukhametov

unread,
Feb 6, 2022, 12:16:51 PM2/6/22
to ChromeDriver Users
same problem here, after upgrading chrome to 98  
Message: unknown error: Cannot construct KeyEvent from non-typeable key (Session info: chrome=98.0.4758.82)

четверг, 3 февраля 2022 г. в 12:41:38 UTC+3, farid...@gmail.com:

Rayane Chougar

unread,
Feb 7, 2022, 5:45:46 AM2/7/22
to ChromeDriver Users
Hi,

I have the error after upgrading my chrome to 98.
Cannot construct KeyEvent from non-typeable key

maybe we have to downgrade chrome until it will be fixed

Said Tahali

unread,
Feb 7, 2022, 9:21:50 AM2/7/22
to ChromeDriver Users
is this issue not going to be fixed? it is affecting the whole world now :(
WebDriverException: Message: unknown error: Cannot construct KeyEvent from non-typeable key
  (Session info: headless chrome=98.0.4758.80)

Vladimir Nechaev

unread,
Feb 7, 2022, 2:33:31 PM2/7/22
to ChromeDriver Users
Dear ChromeDriver users,

The issues with sendKeys similar to chromedriver:3999 and chromedriver:4018 have appeared due to the commit fixing chromedriver:2269.
That commit has been reverted and we are currently exploring a possibility of propagating this revert to branches 98 and 99.
We will keep you posted.

Sincerely,
The ChromeDriver Team



Nicolò Zorzetto

unread,
Feb 8, 2022, 5:00:29 PM2/8/22
to ChromeDriver Users
hey, has this been fixed? I am using version 98.0.4658.80 and bumping into the error the others have.
Thank you

Jesse Brown

unread,
Feb 8, 2022, 5:53:58 PM2/8/22
to Nicolò Zorzetto, ChromeDriver Users
I had zero issues with this update, perhaps it's time to review your code and replace deprecated functions.


Julien Valery

unread,
Feb 9, 2022, 3:55:49 AM2/9/22
to ChromeDriver Users
Hello, 

I can confirm it is the case specially when for example you are typing a password into an input field with characters like # or ? in it. 

Really really annoying as we got a policy internally and I can not downgrade anymore to version 97.

Can't wait for next release to be rolled out.

Thank you,

Sidhant Panda

unread,
Feb 9, 2022, 6:31:34 AM2/9/22
to ChromeDriver Users
Still not solved..... I can verify that. Waiting since 2 days ^^. Although this problem can be solved using ACTIONCHAINS, but still........ 

Sidhant Panda

unread,
Feb 9, 2022, 6:33:18 AM2/9/22
to ChromeDriver Users
Deprecated function and non-typeable key are two different problems. So everyone, dont waste time on reviewing the code, rather use an alternative (using Actionchains) or wait for the damn fix

On Tuesday, 8 February 2022 at 23:53:58 UTC+1 jpbro...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages