使用UITableViewCell时,UIAutomation录制无法正常工作

时间:2015-04-23 12:31:16

标签: ios uitableview ios-ui-automation

我有一个简单的应用程序,显示包含3个单元格的表视图。 1.第一个单元格只有按钮。 2.第二个单元格有按钮和标签。 3.第三个细胞只有标签。

使用Xcode乐器录制时,代码生成不正确:

var target = UIATarget.localTarget();

//tap background of each cell
target.frontMostApp().mainWindow().tableViews()[0].cells()[0].buttons()["Button"].tap();
target.frontMostApp().mainWindow().tableViews()[0].cells()[1].tap();
target.frontMostApp().mainWindow().tableViews()[0].cells()[2].tap();

//tap button of each cell
target.frontMostApp().mainWindow().tableViews()[0].cells()[0].tap();
target.frontMostApp().mainWindow().tableViews()[0].cells()[1].tap();
//this cell has no button

//tap label of each cell
//this cell has no label
target.frontMostApp().mainWindow().tableViews()[0].tapWithOptions({tapOffset:{x:0.49, y:0.25}});
target.frontMostApp().mainWindow().tableViews()[0].tapWithOptions({tapOffset:{x:0.40, y:0.43}});

似乎记录器无法识别按下的视图并插入其他内容。

Xcode工具或行为中的这个错误是否与UIAccessibility有关?

0 个答案:

没有答案