Xcode 7.1投掷" UI测试失败"当我点击XCT中的文本字段或按钮时。它一直工作到xcode7.0.1

时间:2015-10-29 10:08:03

标签: xcode xctest

app.buttons.elementBoundByIndex(9).tap()
app.buttons["New Sale"].tap()
/*this is the textfield i am trying to tap*/
app.textFields.elementBoundByIndex(0).pressForDuration(2)

错误是:

<unknown>: UI Testing Failure - Failed to scroll to visible (by AX action) 
TextField 0x7fa3c96c02b0: traits: 146029150208, {{272.0, 315.0}, {480.0, 40.0}}, 
placeholderValue: 'Select', 
error: Error -25204 performing AXAction 2003

1 个答案:

答案 0 :(得分:0)

我首先滚动到元素,然后点击:

解决了这个问题
let textField = app.textFields.elementBoundByIndex(0)
app.scrollToElement(textField)
textField.tap()