【发布时间】:2012-03-22 19:17:48
【问题描述】:
我正在编写我的第一个 UI 自动化脚本,但在下面的 deactivateAppForDuration 行遇到了故障:
// Verify password field is shown when app is moved to the foreground
UIALogger.logMessage("move app to background");
target.deactivateAppForDuration(10);
UIALogger.logMessage("move app to foreground");
我从 Instruments 得到的错误是:
脚本引发未捕获的 JavaScript 错误:无法对无效元素执行操作:UIAElementNil from target.frontMostApp().switcherScrollView().buttons()["TimeClock"]
我在测试设备上看到的是应用程序已切换到后台,并且正在显示 iOS 应用程序切换器。我可以看到我的应用程序(TimeClock)。从错误消息和设备屏幕中都可以看出,UI 自动化无法选择我的应用程序以转换到前台。
还有其他人遇到过这个问题吗?有解决办法吗?
谢谢。
【问题讨论】:
标签: ios ios-ui-automation