-[XCUIapplication typeText:] doesn't work if the first responder is a UIControl that conforms to UIKeyInput

Originator:avedesk
Number:rdar://34932309 Date Originated:11-Oct-2017 03:40 PM
Status:Open Resolved:
Product:iOS + SDK Product Version:iOS 11
Classification:Serious Bug Reproducible:Always
 
Summary:
We are using a custom UIControl  that conforms to UIKeyInput for inputting a PIN number in our app. Unfortunately, -[XCUIApplication typeText:] doesn't work in this case.

Steps to Reproduce:
1. Have a UIControl that conforms to UIKeyInput
2. Make it a firstResponder

Expected Results:
-[XCUIApplication typeText:] works fine to simulate typing into this control

Actual Results:
Doesn't work, exception is thrown: "Assertion Failure: Neither element nor any descendant has keyboard focus."

Version:
iOS 11

Notes:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!