1、 test failure: -[HallTestCase testStartLiving] failed: UI Testing Failure - Unable to find hit point for Button 0x1415a9530: traits: 8589934849, { {288.0, 140.5}, {72.0, 27.0}}, identifier: '1', label: 'mg music xz002 '
问题原因:当前点击的坐标点不在指定element的frame内或者指定element当前不可点击 解决方法: (1)通过计算element准确坐标点来点击坐标; (2)在点击element之前,给出一个等待时间;
2、 test failure: -[HallTestCase testStartLiving] failed: UI Testing Failure - Failed to get snapshot within 15.0s
问题原因:由于iOS版本过高或者Xcode版本过低,无法在真机上运行UI Testing 解决方法:iOS 10.0.1以上版本配合Xcode8.1以上版本
3、 test failure: -[inkeUITests testStartLiving] failed: UI Testing Failure - Multiple matches found:
问题原因:一般出现在当前页面同时出现两个identifiers完全相同的element 解决方法:设置identifiers唯一性
4、 test failure: -[inkeUITests testStartLiving] failed: UI Testing Failure - Did not receive view did disappear notification within 2.0s
问题原因:在对element进行action操作时,上一个view或者viewcontroller未完全消失; 解决方法:在点击element之前,给出一个等待时间;
5、 test failure: -[inkeUITests testStartLiving] failed: UI Testing Failure - Failed to scroll to visible (by AX action) Button 0x12f065870: traits: 8724152321, { {8.0, 26.0}, {46.0, 30.0}}, error: Error -25204 performing AXAction 2003
问题原因: (1)当前element存在,但是不可见; (2)当前element无法点击到其hit区域
6、 App animations complete notification not received, will attempt to continue. Synthesize event Wait for app to idle
实现点击控件操作时长时间无点击效果,控制台输出信息出现以上信息;
原因:当前操作页面有正在执行的动画,没有接收到动画结束的通知。(页面处于active状态,无法进行UI Testing操作) 解决方法: (1)等待动画结束后再进行操作; (2)若对当前测试无实质性的影响,可先去掉该动画;