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.

[🐛 Bug]: Send_keys does not accept underscore when I use chromedriver 98

See original GitHub issue

What happened?

I use a python binding of selenium. After updating the version of chromedriver from 97 to 98, I found that send_keys raised the following exception when I include underscore into the input value.

selenium.common.exceptions.WebDriverException: Message: unknown error: Cannot construct KeyEvent from non-typeable key

Could anyone take a look at the problem? Thank you

Note: it may be reproducible only on macOS.

How can we reproduce the issue?

driver = webdriver.Chrome()
driver.get('https://www.google.com/')
search_box = driver.find_element_by_name("q")
search_box.send_keys('foo')
search_box.send_keys('foo_boo')

Relevant log output

---------------------------------------------------------------------------
WebDriverException                        Traceback (most recent call last)
<ipython-input-20-4fe2e3e66933> in <module>
      3 search_box = driver.find_element_by_name("q")
      4 search_box.send_keys('foo')
----> 5 search_box.send_keys('foo_boo')

~/opt/anaconda3/envs/py37/lib/python3.7/site-packages/selenium/webdriver/remote/webelement.py in send_keys(self, *value)
    477         self._execute(Command.SEND_KEYS_TO_ELEMENT,
    478                       {'text': "".join(keys_to_typing(value)),
--> 479                        'value': keys_to_typing(value)})
    480 
    481     # RenderedWebElement Items

~/opt/anaconda3/envs/py37/lib/python3.7/site-packages/selenium/webdriver/remote/webelement.py in _execute(self, command, params)
    626             params = {}
    627         params['id'] = self._id
--> 628         return self._parent.execute(command, params)
    629 
    630     def find_element(self, by=By.ID, value=None):

~/opt/anaconda3/envs/py37/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py in execute(self, driver_command, params)
    318         response = self.command_executor.execute(driver_command, params)
    319         if response:
--> 320             self.error_handler.check_response(response)
    321             response['value'] = self._unwrap_value(
    322                 response.get('value', None))

~/opt/anaconda3/envs/py37/lib/python3.7/site-packages/selenium/webdriver/remote/errorhandler.py in check_response(self, response)
    240                 alert_text = value['alert'].get('text')
    241             raise exception_class(message, screen, stacktrace, alert_text)
--> 242         raise exception_class(message, screen, stacktrace)
    243 
    244     def _value_or_default(self, obj, key, default):

WebDriverException: Message: unknown error: Cannot construct KeyEvent from non-typeable key
  (Session info: chrome=98.0.4758.80)

Operating System

macOS

Selenium version

Python 3.13.0

What are the browser(s) and version(s) where you see this issue?

Google Chrome 98.0.4758.80

What are the browser driver(s) and version(s) where you see this issue?

ChromeDriver 98.0.4758.48

Are you using Selenium Grid?

No

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
AutomatedTestercommented, Feb 3, 2022

This is definitely a Chromedriver issue. I have recreated it with the selenium test suite.

1reaction
JackAllTrades-MoNcommented, Feb 3, 2022

I found something that might be related to the issue above on the chromedriver-users group: https://groups.google.com/g/chromedriver-users/c/8WTsbereIO4/m/_aeQGxN7AwAJ

Read more comments on GitHub >

github_iconTop Results From Across the Web

1771 - sendKeys() sometimes doesn't enter all the characters ...
Hi! Since upgrading to chromeDriver version 2.28 we have started experience "sometimes" issue. It looks like not all characters entered in input ...
Read more >
'sendKeys' are not working in Selenium WebDriver
I am able to clear the value of my textbox with driver.findElement(By.name("name")).clear(); , but I'm unable to put any value using driver.findElement ...
Read more >
Safari Technology Preview Release Notes - Apple Developer
Safari Technology Preview Release Notes. Release 159. WebAssembly. Fixed error message for local.get (256176@main). JavaScript. Changed to allow ...
Read more >
with Chromedriver 98.0.4758.80 the sendkeys adds a strange ...
We're getting the same issue in Katalon today, since upgrading to Chromedriver 98. It basically makes Send Keys unusable, and unfortunately we haven't...
Read more >
Selenium Questions Part4: User Actions and Selenium Scripts
Set the webdriver.chrome.driver property to the ... Answer: User can use sendKeys(“String to be entered”) to enter the string in the textbox ...
Read more >

github_iconTop Related Medium Post

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