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

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

This is my case:

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


        
24条回答
  •  失恋的感觉
    2020-12-12 10:56

    func pasteTextFieldText(app:XCUIApplication, element:XCUIElement, value:String, clearText:Bool) {
        // Get the password into the pasteboard buffer
        UIPasteboard.generalPasteboard().string = value
    
        // Bring up the popup menu on the password field
        element.tap()
    
        if clearText {
            element.buttons["Clear text"].tap()
        }
    
        element.doubleTap()
    
        // Tap the Paste button to input the password
        app.menuItems["Paste"].tap()
    }
    

提交回复
热议问题