After recording a test, I have this test code that has been generated.
func testAddCustomerToWaitingQueue() {
let app = XCUIApplication()
app.buttons["AddButton"].tap()
let firstLastNameTextField = app.textFields["First & Last Name"]
firstLastNameTextField.tap()
firstLastNameTextField.typeText("Bill Smith")
app.textFields["Client Description"].typeText("A rather severe looking chap")
let tablesQuery = app.tables
tablesQuery/@START_MENU_TOKEN@*/.staticTexts["Rep Name"]/[[".cells.staticTexts[\"Rep Name\"]",".staticTexts[\"Rep Name\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/.tap()
tablesQuery/@START_MENU_TOKEN@*/.staticTexts["Paul"]/[[".cells.staticTexts[\"Paul\"]",".staticTexts[\"Paul\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/.tap()
tablesQuery/@START_MENU_TOKEN@*/.staticTexts["Reason for Visit"]/[[".cells.staticTexts[\"Reason for Visit\"]",".staticTexts[\"Reason for Visit\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/.tap()
tablesQuery/@START_MENU_TOKEN@*/.staticTexts["Account - Opening"]/[[".cells.staticTexts[\"Account - Opening\"]",".staticTexts[\"Account - Opening\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/.tap()
let commentsTextField = app.textFields["Comments"]
commentsTextField.typeText("")
commentsTextField.typeText("Please see post haste")
app.buttons["Create"].tap()
app.buttons["Confirm"].tap()
}
Yet, when I run the tests, line 09 always fails with:
UI Testing Failure - Neither element nor any descendant has keyboard focus. Element:
What have I done wrong here? I'm using Xcode 7 beta 3 (7A152u) and recorded the test from the simulator.