Using non-alphanumeric characters in SendKeys sends the incorrect keys
Meta
OS: Windows 10 Pro Selenium Version: 3.5.1 (C#) IDE: Visual Studios Enterprise 2017 Selenium Server: 3.5.2 Server OS: Windows 7 Enterprise Browsers: Chrome & IE Browser Versions: 60.0.3112.113 (Official Build) (32-bit) & 11.0.9600.18762 (Update v11.0.45) Chrome Driver Version: 2.31 IE Driver Version: 3.4.0
Description
When I use driver.SendKeys(key) and the key is non-alphanumeric, like Keys.CONTROL or Keys.TAB. It will send junk, like "?" and "." instead of the actual key.
Details
I recently updated my company's Grid to v3.5.1 from 2.37.0. Along with it, I updated Selenium to 3.5.1, the chrome driver to 2.31, and installed the Firefox gecko driver. Locally, when I run tests they run fine. However, when I use SendKeys while utilizing a remote web driver it sends the incorrect key code in Chrome and IE. The only difference between chrome on the server and locally is that the server version is 32bit and my local version is 64 bit (this shouldn't really be a problem because the only version for chrome driver is 32-bit for windows anyways). I thought this was just a chrome driver problem because the problem resolved itself in FireFox when I updated to Selenium to 3.5.1. However, when I tried IE I have the same issue.
Example
I apologize that I can not provide the exact code; my company's project is not open source. However, I have been able to reproduce this issues consistently on each webpage I visit using the above specifications. Here's some pseudo code if that helps:
- Navigate to https://www.cognitoforms.com/forms/build.
- After document load, switch to the 'c-build' frame
- Add a text field to the form (driver.FindElement(By.ClassName("c-forms-setting-add-field")).FindElement(By.CSS("[data-code='Text']")).Click()
- send keys to the "Label" field (driver.FindElement(By.Id("c-forms-settings-field")).FindElement(By.Tag("input")).SendKeys(Keys.CONTROL + "a");)
This used to select all the text in the input field and now just sends "?a". Also, sorry if there's some syntax errors, I wrote it on the fly.
Duplicate of #4462