Open
Description
Description
Summary
In the current version of our Windows driver based on the WebDriver protocol, we have identified an issue with the actions
endpoint, specifically with the KeyDown
and KeyUp
actions. These actions do not function properly under certain conditions, leading to inconsistent behavior during automated testing.
Steps to Reproduce
- Use the
actions
functionality to send a sequence ofKeyDown
andKeyUp
actions. - Observe that sometimes the keys do not register as pressed (
KeyDown
) or released (KeyUp
).
Expected Behavior
The KeyDown
and KeyUp
actions consistently register the pressing and releasing of keys without fail.
Actual Behavior
The KeyDown
and KeyUp
actions intermittently fail to register, causing automation to be unreliable.
Workaround
A temporary workaround for this issue is to use the sendinputs
endpoint. This can be implemented using a monkey patch on the driver or an extension.
Workaround Details
- Endpoint:
POST /user32/session/{session-id}/inputs
- Request Body: An array of scan codes, e.g.,
{ "scanCodes": ["Up", "Down", "Enter", "Esc"] }
By using this endpoint, key inputs can be reliably sent to simulate KeyDown
and KeyUp
actions.
Environment
- Driver Version: 2024.06.29.7
- Operating System: Windows
- WebDriver Client: Selenium 4.x
Additional Information
- This issue is intermittent and might not be reproducible in all environments.