1、失败日志有“Get windows failed/GetRootByWindow failed”错误信息 问题描述
UI测试用例执行失败,检察hilog日志发现日志中有“Get windows failed/GetRootByWindow failed”错误信息。 可能原因
系统ArkUI开关未开启,导致被测试界面控件树信息未天生。 解决方法
执行如下下令,并重启装备再次执行用例。
hdc shell param set persist.ace.testmode.enabled 1
<strong>shell</strong>
复制代码
2、失败日志有“uitest-api dose not allow calling concurrently”错误信息 问题描述
UI测试用例执行失败,检察hilog日志发现日志中有“uitest-api dose not allow calling concurrently”错误信息。 可能原因
1.用例中UI测试框架提供异步接口没有增加await语法糖调用。
2.多历程执行UI测试用例,导致拉起多个UITest历程,框架不支持多历程调用。 解决方法
1.检查用例实现,异步接口增加await语法糖调用。
2.制止多历程执行UI测试用例。 3、失败日志有“does not exist on current UI! Check if the UI has changed after you got the widget object”错误信息 问题描述
UI测试用例执行失败,检察hilog日志发现日志中有“does not exist on current UI! Check if the UI has changed after you got the widget object”错误信息。 可能原因
在用例中代码查找到目的控件后,装备界面发生了变化,导致查找到的控件丢失,无法举行下一步的模拟操纵。 解决方法
重新执行UI测试用例。