Testing the iOS user interface, choosing safe text input textField

I have a password and password conf textFields, which I used "Secure text input" to hide the password. However, when I run the user interface tests, these fields cannot be found, getting

UI Test Error - No Matches Found for TextField "Password"

I am trying to select fields like this:

let passwordTextField = app.textFields["password"] 

but then it fails when I try to click:

 passwordTextField.tap() 

Any ideas on how I can access the field?

+5
source share
1 answer

As discussed in the comments, use the secureTextFields selector when accessing a protected text field.

 let passwordTextField = app.secureTextFields["password"] passwordTextField.tap() passwordTextField.typeText("my secure password") 
+18
source

Source: https://habr.com/ru/post/1234386/


All Articles