Skip to content

KeyDown and KeyUp Actions Endpoint Issue #11

Open
@gravity-api

Description

@gravity-api

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

  1. Use the actions functionality to send a sequence of KeyDown and KeyUp actions.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions