UI Testing Failure - Neither element nor any descendant has keyboard focus on secureTextField

后端 未结 24 1563
难免孤独
难免孤独 2020-12-12 10:41

This is my case:

let passwordSecureTextField = app.secureTextFields[\"password\"]
passwordSecureTextField.tap()
passwordSecureTextField.typeText(\"wrong_pass         


        
24条回答
  •  旧时难觅i
    2020-12-12 11:00

    Stanislav has the right idea.

    In a team environment, you need something that will automatically work. I've come up with a fix here on my blog.

    Basically you just paste:

    UIPasteboard.generalPasteboard().string = "Their password"
    let passwordSecureTextField = app.secureTextFields["password"]
    passwordSecureTextField.pressForDuration(1.1)
    app.menuItems["Paste"].tap()
    

提交回复
热议问题