Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/103.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios UIImagePickerController编辑时:无法点击按钮()[2]_Ios_Objective C_Uiimagepickercontroller_Ui Automation_Ios Ui Automation - Fatal编程技术网

Ios UIImagePickerController编辑时:无法点击按钮()[2]

Ios UIImagePickerController编辑时:无法点击按钮()[2],ios,objective-c,uiimagepickercontroller,ui-automation,ios-ui-automation,Ios,Objective C,Uiimagepickercontroller,Ui Automation,Ios Ui Automation,在UIImagePickerController的裁剪屏幕中,我试图使用UIAutomation点击“选择”按钮,但出现以下错误: 无法点击target.frontMostApp().mainWindow().buttons()[2] 我正在使用以下代码: var b = target.frontMostApp().mainWindow().buttons()[2]; if (b.checkIsValid()) { UIALogger.logPass("b, " +

在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:name:Choose rect:{{287604},{74,40}

target.frontMostApp().mainWindow().buttons()[2]。点击()

无法点击target.frontMostApp().mainWindow().buttons()[2]

脚本引发未捕获的JavaScript错误:无法在新%20Script的第13行上点击target.frontMostApp().mainWindow().buttons()[2]


有人知道如何测试这个?。感谢您的帮助。

我也遇到了同样的问题,我找到了以下解决方案:

var b = target.frontMostApp().mainWindow().buttons()[2];
var x = b.rect().origin.x + 1;
var y = b.rect().origin.y + 1;
target.tap({x:x, y:y});
这不是很好,但它很有效