我只是想用UI自动化测试我的iOS用户界面,但是在将文本输入到UITextFields时我遇到了困难.文档说,方法“setValue(…)”应该做的伎俩,但它没有.
Script threw an uncaught JavaScript error: Unexpected error in -[UIATextField_0x9952690 setValue:],/SourceCache/UIAutomation_Sim/UIAutomation-271/Framework/UIAElement.m line 1142,kAXErrorSuccess on line 15 of login.js,#0 setValue()
var textfields = UIATarget.localTarget().frontMostApp().mainWindow().textFields(); username = textfields["username"]; username.setValue("test");
我的第二个解决方案是这个JS项目:
https://github.com/alexvollmer/tuneup_js#readme
它有一个用于文本字段的“typeString”方法,但它有点儿错误,并且在输入数字和大写字母时失败.@H_502_3@
我正在使用iOS6.1,
仪器版本4.6(46000),
Xcode版本4.6(4H127).@H_502_3@
任何帮助表示赞赏!@H_502_3@