kandi background
kandi background
Explore Kits
kandi background
Explore Kits
kandi background
Explore Kits
kandi background
Explore Kits
Explore all Email open source software, libraries, packages, source code, cloud functions and APIs.

Popular New Releases in Email

PHPMailer 6.6.0

v4.12.0

1.10.3

2.1.1

PHPMailer

PHPMailer 6.6.0

mjml

v4.12.0

Mailspring

1.10.3

postal

2.1.1

mailinabox

Popular Libraries in Email

Trending New libraries in Email

Top Authors in Email

1

20 Libraries

2466

2

16 Libraries

8136

3

14 Libraries

590

4

13 Libraries

981

5

13 Libraries

708

6

13 Libraries

4491

7

11 Libraries

118

8

10 Libraries

1970

9

9 Libraries

14664

10

8 Libraries

988

1

20 Libraries

2466

2

16 Libraries

8136

3

14 Libraries

590

4

13 Libraries

981

5

13 Libraries

708

6

13 Libraries

4491

7

11 Libraries

118

8

10 Libraries

1970

9

9 Libraries

14664

10

8 Libraries

988

Trending Kits in Email

No Trending Kits are available at this moment for Email

Trending Discussions on Email

    Selenium-chromedriver: Cannot construct KeyEvent from non-typeable key
    Action requested: Declare your Ad ID permission
    Test functions cannot both take a 'done' callback
    Why @FocusState Crashing SwiftUI Preview
    How do I fix a Firebase 9.0 import error? "Attempted import error: 'firebase/app' does not contain a default export (imported as 'firebase')."
    FirebaseOptions cannot be null when creating the default app
    Activiti 6.0.0 UI app / in-memory H2 database in tomcat9 / java version "9.0.1"
    I worked on a private repo in GitHub then made it public. Can I make my activity visible?
    How do I run multiple sites on the same server using docker and nginx?
    Default route always execute in react router

QUESTION

Selenium-chromedriver: Cannot construct KeyEvent from non-typeable key

Asked 2022-Mar-25 at 12:17

I updated my Chrome and Chromedriver to the latest version yesterday, and since then I get the following error messages when running my Cucumber features:

1....
2unknown error: Cannot construct KeyEvent from non-typeable key
3        (Session info: chrome=98.0.4758.80) (Selenium::WebDriver::Error::UnknownError)
4      #0 0x55e9ce6a4093 <unknown>
5      #1 0x55e9ce16a648 <unknown>
6      #2 0x55e9ce1a9866 <unknown>
7      #3 0x55e9ce1cbd29 <unknown>
8      .....
9

I try to fill a text field with Capybara's fill_in method. While debugging I noticed that Capybara has problems especially with the symbols @ and \. Every other character can be written into the text field without any problems.

The code that triggers the error looks like this

1....
2unknown error: Cannot construct KeyEvent from non-typeable key
3        (Session info: chrome=98.0.4758.80) (Selenium::WebDriver::Error::UnknownError)
4      #0 0x55e9ce6a4093 <unknown>
5      #1 0x55e9ce16a648 <unknown>
6      #2 0x55e9ce1a9866 <unknown>
7      #3 0x55e9ce1cbd29 <unknown>
8      .....
9def sign_in(user)
10  visit new_sign_in_path
11  fill_in 'Email', with: user.email
12  fill_in 'Password', with: user.password
13  click_button 'Sign in'
14end
15

user.email contains a string like "example1@mail.com".

I work with Rails 6.1.3.1, Cucumber 5.3.0, Chromedriver 98.0.4758.48, capybara 3.35.3

The error only occurs on features that are tagged with @javascript

Do you have any ideas what causes this error or how to fix it?

ANSWER

Answered 2022-Feb-03 at 08:25

It seems something has changed in the new version of ChromeDriver and it is no longer possible to send some special chars directly using send_keys method.

In this link you will see how it is solved (in C#) --> Selenium - SendKeys("@") write an "à"

And regarding python implementation, check this out --> https://www.geeksforgeeks.org/special-keys-in-selenium-python/

Specifically, my implementation was (using MAC):

copy icondownload icon

1....
2unknown error: Cannot construct KeyEvent from non-typeable key
3        (Session info: chrome=98.0.4758.80) (Selenium::WebDriver::Error::UnknownError)
4      #0 0x55e9ce6a4093 <unknown>
5      #1 0x55e9ce16a648 <unknown>
6      #2 0x55e9ce1a9866 <unknown>
7      #3 0x55e9ce1cbd29 <unknown>
8      .....
9def sign_in(user)
10  visit new_sign_in_path
11  fill_in 'Email', with: user.email
12  fill_in 'Password', with: user.password
13  click_button 'Sign in'
14end
15driver.find_element('.email-input', 'user@mail.com')
16

Now I had to change it by:

copy icondownload icon

1....
2unknown error: Cannot construct KeyEvent from non-typeable key
3        (Session info: chrome=98.0.4758.80) (Selenium::WebDriver::Error::UnknownError)
4      #0 0x55e9ce6a4093 <unknown>
5      #1 0x55e9ce16a648 <unknown>
6      #2 0x55e9ce1a9866 <unknown>
7      #3 0x55e9ce1cbd29 <unknown>
8      .....
9def sign_in(user)
10  visit new_sign_in_path
11  fill_in 'Email', with: user.email
12  fill_in 'Password', with: user.password
13  click_button 'Sign in'
14end
15driver.find_element('.email-input', 'user@mail.com')
16from selenium.webdriver.common.keys import Keys
17from selenium.webdriver.common.action_chains import ActionChains
18
19emailParts = 'user@mail.com'.split('@')
20emailElement = driver.find_element('.email-input')
21
22emailElement.send_keys(emailParts[0])
23action = ActionChains(driver)
24action.key_down(Keys.ALT).send_keys('2').key_up(Keys.ALT).perform()
25emailElement.send_keys(emailParts[1])
26

Source https://stackoverflow.com/questions/70967207