【发布时间】:2015-02-14 05:36:58
【问题描述】:
在 UIImagePickerController 的裁剪屏幕中,我尝试使用 UIAutomation 点击“选择”按钮,但出现此错误:
target.frontMostApp().mainWindow().buttons()[2] 无法点击
我正在使用此代码:
var b = target.frontMostApp().mainWindow().buttons()[2];
if (b.checkIsValid()) {
UIALogger.logPass("b, " + b.isValid() + ", " + b.isEnabled());
b.logElement();
b.tap();
} else {
UIALogger.logFail("!b");
}
这是输出:
b,真实,1
UIAButton:名称:选择矩形:{{287, 604}, {74, 40}}
target.frontMostApp().mainWindow().buttons()[2].tap()
target.frontMostApp().mainWindow().buttons()[2] 无法点击
脚本抛出未捕获的 JavaScript 错误:target.frontMostApp().mainWindow().buttons()[2] 无法在 New%20Script 的第 13 行点击
有人知道如何测试吗?感谢您的帮助。
【问题讨论】:
标签: ios objective-c uiimagepickercontroller ui-automation ios-ui-automation