This is my case: let passwordSecureTextField = app.secureTextFields["password"] passwordSecureTextField.tap() passwordSecureTextField.typeText("wrong_password") //here is an error UI Testing Failure - Neither element nor any descendant has keyboard focus. Element: What is wrong? This is working nice for normal textFields, but problem arise only with secureTextFields. Any workarounds?