Skip to content

Unexpected behavior of hardware keyboard focus in UITests #1004

@bananaRanger

Description

@bananaRanger

Hello, dear Appium team!

I was faced with unexpected behavior of hardware keyboard focus in UITests.

A clear description of the problem

When running UITests on the iOS Simulator with both "Full Keyboard Access" and "Connect Hardware Keyboard" options enabled, there is a noticeable delay between keyboard actions for focus managing (like pressing Tab or arrow keys). The delay seems to increase with repeated input and suggests that events are being queued instead of processed immediately.
I will describe why I have such an assumption later.

A step-by-step set of instructions to reproduce the problem

  1. Launch the iOS Simulator.
  2. Enable both "Full Keyboard Access" and "Connect Hardware Keyboard" in the Simulator settings.
  3. Run a UITest on a target application (ideally an endless or long-running test).
  4. Once the app is launched, press the Tab key several times.
  5. Observe the delay in focus movement.
  6. Optionally, press the Tab or arrow keys rapidly, then stop the UITest.
  7. After stopping, you’ll see a burst of rapid focus changes.

What results you expected

We expected keyboard actions (like Tab) to be handled immediately and the UI focus to update smoothly during UITests.

What results you saw

There was a 4–10 (end more) second delay between pressing keys and seeing a response. All stacked keyboard events (used for managing focus) are performed all at once after stopping the UITest.

The version of Xcode you are using

Xcode: Version 16.3 (16E140)
Simulator: iPhone 16 Pro (iOS 18.4 and 18.1)
Simulator: iPad Pro 11-inch (M4) (iPadOS 17.5)

The version of WDA you are using

WDA: 9.5.0 (the latest)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions