You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are happily using HtmlUnit 3.4 with Selenium and wanted to get rid of some legacy usage of the deprecated KeyboardEvent.keyCode in our web application.
The most portable replacement would be KeyboardEvent.key, but this is currently not working for arrow keys. For example sendKeys(Keys.UP) on a element yields & in JavaScript for KeyboardEvent.key as opposed to the expected "ArrowUp". & in ASCII is 0x26 which is the corresponding KeyboardEvent.keyCode.
Stating from the implementation the current support for KeyboardEvent.key seems to be limited to printable characters, "Shift", "Enter" and Period (KeyboardEvent.determineKey()).
As KeyboardEvent.key is part of the W3C UI Events standard and is broadly supported by current browsers (caniuse) it would be really nice to have this as well in HtmlUnit.
Mozilla provides a extensive table of common control and special characters in the mdn
Thanks for the continuous support and effort you put into HtmlUnit.
Funding
You can sponsor this specific effort via a Polar.sh pledge below
We receive the pledge once the issue is completed & verified
The text was updated successfully, but these errors were encountered:
This is a bigger effort, because there is no real support for special keys in HtmlUnit itself. I guess i have to add something like a stream of key-strokes that support special keys the same way like the ordinary ones.
If this available in HtmlUnit i can use for the web driver.
Will start working on this after some other major bugs are fixed.
We are happily using HtmlUnit 3.4 with Selenium and wanted to get rid of some legacy usage of the deprecated KeyboardEvent.keyCode in our web application.
The most portable replacement would be KeyboardEvent.key, but this is currently not working for arrow keys. For example
sendKeys(Keys.UP)
on a element yields&
in JavaScript forKeyboardEvent.key
as opposed to the expected"ArrowUp"
.&
in ASCII is0x26
which is the correspondingKeyboardEvent.keyCode
.Stating from the implementation the current support for
KeyboardEvent.key
seems to be limited to printable characters,"Shift"
,"Enter"
andPeriod
(KeyboardEvent.determineKey()).As KeyboardEvent.key is part of the W3C UI Events standard and is broadly supported by current browsers (caniuse) it would be really nice to have this as well in HtmlUnit.
Mozilla provides a extensive table of common control and special characters in the mdn
Thanks for the continuous support and effort you put into HtmlUnit.
Funding
The text was updated successfully, but these errors were encountered: