Simulate hardware keyboard button press in Xcode UI test for iPad

XCUIElement has two methods named typeKey(_:modifierFlags:): the first one takes a String as an argument, the second one a XCUIKeyboardKey, which has constants like .downArrow. Now, even if the documentation says that both methods are "Available in macOS and in iPadOS 15 and later", when compiling the UI tests for iOS, the following line

app.typeKey(.downArrow, modifierFlags: [])

produces a compiler error

Type 'String' has no member 'downArrow'

Am I missing something or is there a workaround?

Simulate hardware keyboard button press in Xcode UI test for iPad
 
 
Q