【问题标题】:UIAutomation with custom navigationbar带有自定义导航栏的 UIAutomation
【发布时间】:2013-09-25 02:14:52
【问题描述】:

我没有标准的 NavigationController 也没有 scrollView、TableView ....

一旦应用程序完成启动并在appDelegate 之后,它会转到UIViewController 对象。

在这个viewController的视图上,我有UITextField。如果我想写这个文本文件。通过UIAutomation JavaScript 在许多其他选项中,我尝试了以下方法,但仍然没有运气:

var name = "Test Text"; var textField = UIATarget.localTarget().frontMostApp().mainWindow().textFields()[0]; textField.setValue(name); mainWindow() 之后,我如何能够访问或获取我的UIViewController

【问题讨论】:

    标签: javascript automation ui-automation ios-ui-automation xcode5


    【解决方案1】:

    要获得用户界面元素的层次结构,您可以插入命令UIATarget.localTarget().logElementTree(); 研究此命令的输出,您将能够猜出正确的表达式。在某些情况下,您需要等到每个项目都创建完毕(例如使用UIATarget.localTarget().delay(1);)后才能登录。

    另一个获得正确答案的机会是在您填写此文本字段(手动)并检查生成的代码时使用仪器进行记录。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-10-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多