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

Popular New Releases in Cucumber

v8.0.0.RC.1

v8.1.2

v3.8.1

gherkin/go/v23.0.1

cucumber-json-formatter/v7.0.1

cucumber-ruby

v8.0.0.RC.1

cucumber-js

v8.1.2

Behat

v3.8.1

common

gherkin/go/v23.0.1

cucumber

cucumber-json-formatter/v7.0.1

Popular Libraries in Cucumber

Trending New libraries in Cucumber

Top Authors in Cucumber

1

26 Libraries

23014

2

14 Libraries

126

3

9 Libraries

37

4

8 Libraries

242

5

7 Libraries

89

6

7 Libraries

78

7

6 Libraries

167

8

6 Libraries

122

9

6 Libraries

37

10

6 Libraries

25

1

26 Libraries

23014

2

14 Libraries

126

3

9 Libraries

37

4

8 Libraries

242

5

7 Libraries

89

6

7 Libraries

78

7

6 Libraries

167

8

6 Libraries

122

9

6 Libraries

37

10

6 Libraries

25

Trending Kits in Cucumber

No Trending Kits are available at this moment for Cucumber

Trending Discussions on Cucumber

    Selenium-chromedriver: Cannot construct KeyEvent from non-typeable key
    Is it possible to have Cucumber steps and Karate steps recognised at the same time in different feature files?
    Counting unique list items
    Cypress stopped working with cucumber-preprocessor after 9.3.0
    java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible:module
    how can I pass the cypress.json file to cypress-tags
    Unable to build and deploy Rails 6.0.4.1 app on heroku - Throws gyp verb cli error
    Clustering in R using K-mean
    Selenium / Java : How to write element locator for an element with aria-selected=false
    Could not create a cucumber expression for scenario step

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

Community Discussions contain sources that include Stack Exchange Network

    Selenium-chromedriver: Cannot construct KeyEvent from non-typeable key
    Is it possible to have Cucumber steps and Karate steps recognised at the same time in different feature files?
    Counting unique list items
    Cypress stopped working with cucumber-preprocessor after 9.3.0
    java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible:module
    how can I pass the cypress.json file to cypress-tags
    Unable to build and deploy Rails 6.0.4.1 app on heroku - Throws gyp verb cli error
    Clustering in R using K-mean
    Selenium / Java : How to write element locator for an element with aria-selected=false
    Could not create a cucumber expression for scenario step

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

Community Discussions contain sources that include Stack Exchange Network

Tutorials and Learning Resources in Cucumber

Tutorials and Learning Resources are not available at this moment for Cucumber

Share this Page

share link

Get latest updates on Cucumber