【发布时间】:2017-10-11 14:52:01
【问题描述】:
我是 ui 测试的新手。在录制过程中,当我点击 ui-collection view时,第一个对象显示在UI上,对应于测试示例方法中编写的代码是:
XCUIElement *window = [[app childrenMatchingType:XCUIElementTypeWindow] elementBoundByIndex:0];
XCUIElement *element2 = [[[[window childrenMatchingType:XCUIElementTypeOther].element childrenMatchingType:XCUIElementTypeOther].element childrenMatchingType:XCUIElementTypeOther].element childrenMatchingType:XCUIElementTypeOther].element;
[element2 tap];
当自动化测试示例方法时,无法获取 ui-collection 视图的第一个对象。请提出一种方法来做到这一点。 提前致谢。
【问题讨论】:
-
我刚刚找到了一种方法,只需在属性检查器中取消选中可访问性启用并重新运行记录。
标签: ios objective-c xcode uicollectionview xcode-ui-testing