如何在使用UI自動化測試時取消鍵盤? 我一直在尋找UIAElement和UIATextField文檔,但找不到這樣的建議。UIAutomation [UITextField resignFirstResponder]
var textField = toolbar.textFields()[0];
var textView = toolbar.textViews()[0];
function testFeature1() {
if (textField.hasKeyboardFocus() || textView.hasKeyboardFocus()) {
// Resign first responder .. How?
}
// Do my tests
}
javascript代碼在iOS? – Mil0R3
是的。我開始寫自動化測試,他們都在JavaScript :) – nacho4d
在Java腳本上下文,試試這個=> http://stackoverflow.com/questions/5937339/ipad-safari-make-keyboard-disappear – Peres