HarmonyOS 鸿蒙Next uitest uiRecord record录制用户操作时有部分操作没有录上

发布于 1周前 作者 ionicwang 最后一次编辑是 5天前 来自 鸿蒙OS

页面切换后如果操作过快就容易丢失事件

正常情况下录制数据如下

{"ABILITY":"EntryAbility","BUNDLE":"com.example.demo","CENTER_X":"","CENTER_Y":"","EVENT_TYPE":"pointer","LENGTH":"0","OP_TYPE":"click","VELO":"0.000000","direction.X":"0.000000","direction.Y":"0.000000","duration":165853000.0,"fingerList":[{"LENGTH":"0","MAX_VEL":"40000","VELO":"0.000000","W1_BOUNDS":"[204,828][569,958]","W1_HIER":"ROOT53,0,0,0,0,0","W1_ID":"btn1","W1_Text":"进入文本页","W1_Type":"Button","W2_BOUNDS":"[0,482][1260,1734]","W2_HIER":"ROOT53,0,0,0,3,0","W2_ID":"","W2_Text":"swiper中的text无交互事件","W2_Type":"Text","X2_POSI":"461","X_POSI":"461","Y2_POSI":"902","Y_POSI":"902","direction.X":"0.000000","direction.Y":"0.000000"}],"fingerNumber":"1"}
{"ABILITY":"EntryAbility","BUNDLE":"com.example.demo","CENTER_X":"","CENTER_Y":"","EVENT_TYPE":"pointer","LENGTH":"0","OP_TYPE":"click","VELO":"0.000000","direction.X":"0.000000","direction.Y":"0.000000","duration":128032000.0,"fingerList":[{"LENGTH":"0","MAX_VEL":"40000","VELO":"0.000000","X2_POSI":"119","X_POSI":"119","Y2_POSI":"205","Y_POSI":"205","direction.X":"0.000000","direction.Y":"0.000000"}],"fingerNumber":"1"}
{"ABILITY":"EntryAbility","BUNDLE":"com.example.demo","CENTER_X":"","CENTER_Y":"","EVENT_TYPE":"pointer","LENGTH":"0","OP_TYPE":"click","VELO":"0.000000","direction.X":"0.000000","direction.Y":"0.000000","duration":142558000.0,"fingerList":[{"LENGTH":"0","MAX_VEL":"40000","VELO":"0.000000","W1_BOUNDS":"[633,828][1057,958]","W1_HIER":"ROOT53,0,0,0,0,1","W1_ID":"btn2","W1_Text":"进入button页","W1_Type":"Button","W2_BOUNDS":"[760,799][1150,929]","W2_HIER":"ROOT53,0,2,1,2","W2_ID":"","W2_Text":"普通按钮","W2_Type":"Button","X2_POSI":"886","X_POSI":"886","Y2_POSI":"894","Y_POSI":"894","direction.X":"0.000000","direction.Y":"0.000000"}],"fingerNumber":"1"}
{"ABILITY":"EntryAbility","BUNDLE":"com.example.demo","CENTER_X":"","CENTER_Y":"","EVENT_TYPE":"pointer","LENGTH":"0","OP_TYPE":"click","VELO":"0.000000","direction.X":"0.000000","direction.Y":"0.000000","duration":149753000.0,"fingerList":[{"LENGTH":"0","MAX_VEL":"40000","VELO":"0.000000","W1_BOUNDS":"[65,165][143,243]","W1_HIER":"ROOT53,0,0,0,0","W1_ID":"","W1_Text":"","W1_Type":"Image","X2_POSI":"110","X_POSI":"110","Y2_POSI":"218","Y_POSI":"218","direction.X":"0.000000","direction.Y":"0.000000"}],"fingerNumber":"1"}
{"ABILITY":"EntryAbility","BUNDLE":"com.example.demo","CENTER_X":"","CENTER_Y":"","EVENT_TYPE":"pointer","LENGTH":"0","OP_TYPE":"click","VELO":"0.000000","direction.X":"0.000000","direction.Y":"0.000000","duration":156254000.0,"fingerList":[{"LENGTH":"0","MAX_VEL":"40000","VELO":"0.000000","W1_BOUNDS":"[77,1022][442,1152]","W1_HIER":"ROOT53,0,0,0,1,0","W1_ID":"btn3","W1_Text":"进入图片页","W1_Type":"Button","W2_BOUNDS":"[82,851][440,1209]","W2_HIER":"ROOT53,0,0,3,0","W2_ID":"","W2_Text":"","W2_Type":"Image","X2_POSI":"346","X_POSI":"346","Y2_POSI":"1070","Y_POSI":"1070","direction.X":"0.000000","direction.Y":"0.000000"}],"fingerNumber":"1"}
{"ABILITY":"EntryAbility","BUNDLE":"com.example.demo","CENTER_X":"","CENTER_Y":"","EVENT_TYPE":"pointer","LENGTH":"0","OP_TYPE":"click","VELO":"0.000000","direction.X":"0.000000","direction.Y":"0.000000","duration":155258000.0,"fingerList":[{"LENGTH":"0","MAX_VEL":"40000","VELO":"0.000000","W1_BOUNDS":"[65,165][143,243]","W1_HIER":"ROOT53,0,0,0,0,0","W1_ID":"","W1_Text":"","W1_Type":"Image","X2_POSI":"93","X_POSI":"93","Y2_POSI":"209","Y_POSI":"209","direction.X":"0.000000","direction.Y":"0.000000"}],"fingerNumber":"1"}
{"ABILITY":"EntryAbility","BUNDLE":"com.example.demo","CENTER_X":"","CENTER_Y":"","EVENT_TYPE":"pointer","LENGTH":"0","OP_TYPE":"click","VELO":"0.000000","direction.X":"0.000000","direction.Y":"0.000000","duration":190091000.0,"fingerList":[{"LENGTH":"0","MAX_VEL":"40000","VELO":"0.000000","W1_BOUNDS":"[800,126][1035,189]","W1_HIER":"ROOT54,0,0,0","W1_ID":"","W1_Text":"结束录制","W1_Type":"Text","W2_BOUNDS":"[859,126][1094,189]","W2_HIER":"ROOT54,0,0,0","W2_ID":"","W2_Text":"开始回放","W2_Type":"Text","X2_POSI":"877","X_POSI":"877","Y2_POSI":"162","Y_POSI":"162","direction.X":"0.000000","direction.Y":"0.000000"}],"fingerNumber":"1"}

但是如果操作得比较快则很明显看到数据有缺失

{"ABILITY":"EntryAbility","BUNDLE":"com.example.demo","CENTER_X":"","CENTER_Y":"","EVENT_TYPE":"pointer","LENGTH":"0","OP_TYPE":"click","VELO":"0.000000","direction.X":"0.000000","direction.Y":"0.000000","duration":116761000.0,"fingerList":[{"LENGTH":"0","MAX_VEL":"40000","VELO":"0.000000","X2_POSI":"114","X_POSI":"114","Y2_POSI":"196","Y_POSI":"196","direction.X":"0.000000","direction.Y":"0.000000"}],"fingerNumber":"1"}
{"ABILITY":"EntryAbility","BUNDLE":"com.example.demo","CENTER_X":"","CENTER_Y":"","EVENT_TYPE":"pointer","LENGTH":"0","OP_TYPE":"doubleClick","VELO":"0.000000","direction.X":"0.000000","direction.Y":"0.000000","duration":122038000.0,"fingerList":[{"LENGTH":"0","MAX_VEL":"40000","VELO":"0.000000","X2_POSI":"110","X_POSI":"110","Y2_POSI":"171","Y_POSI":"171","direction.X":"0.000000","direction.Y":"0.000000"}],"fingerNumber":"1"}
{"ABILITY":"EntryAbility","BUNDLE":"com.example.demo","CENTER_X":"","CENTER_Y":"","EVENT_TYPE":"pointer","LENGTH":"0","OP_TYPE":"doubleClick","VELO":"0.000000","direction.X":"0.000000","direction.Y":"0.000000","duration":131108000.0,"fingerList":[{"LENGTH":"2","MAX_VEL":"40000","VELO":"290.569626","X2_POSI":"84","X_POSI":"84","Y2_POSI":"192","Y_POSI":"188","direction.X":"0.000000","direction.Y":"4.000000"}],"fingerNumber":"1"}
{"ABILITY":"EntryAbility","BUNDLE":"com.example.demo","CENTER_X":"","CENTER_Y":"","EVENT_TYPE":"pointer","LENGTH":"0","OP_TYPE":"click","VELO":"0.000000","direction.X":"0.000000","direction.Y":"0.000000","duration":442837000.0,"fingerList":[{"LENGTH":"0","MAX_VEL":"40000","VELO":"0.000000","W1_BOUNDS":"[800,126][1035,189]","W1_HIER":"ROOT56,0,0,0","W1_ID":"","W1_Text":"结束录制","W1_Type":"Text","W2_BOUNDS":"[859,126][1094,189]","W2_HIER":"ROOT56,0,0,0","W2_ID":"","W2_Text":"开始回放","W2_Type":"Text","X2_POSI":"937","X_POSI":"937","Y2_POSI":"166","Y_POSI":"166","direction.X":"0.000000","direction.Y":"0.000000"}],"fingerNumber":"1"}

总共七个点击操作,操作较快时只录到4个


更多关于HarmonyOS 鸿蒙Next uitest uiRecord record录制用户操作时有部分操作没有录上的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html

3 回复
这个属于正常情况,官方文档中已经做了说明了,录制过程中,需等待当前操作的识别结果在命令行输出后,再进行下一步操作。官方文档链接:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/arkxtest-guidelines-V5#用户录制操作

更多关于HarmonyOS 鸿蒙Next uitest uiRecord record录制用户操作时有部分操作没有录上的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html


这样啊,多谢了🙏

在HarmonyOS鸿蒙系统中,使用uitest的uiRecord功能进行用户操作录制时,若遇到部分操作未能成功录制的问题,可能涉及以下几个因素:

  1. 权限配置:确保应用已获取必要的权限,特别是涉及系统级操作或敏感数据访问时,权限不足可能导致录制不完整。

  2. UI组件兼容性:部分自定义或特殊UI组件可能不被uitest完全支持,导致这些组件上的操作无法被录制。检查涉及的UI组件是否为标准组件或已验证支持的组件。

  3. 系统资源限制:系统资源紧张(如内存、CPU)时,uitest的性能可能受到影响,导致录制不完整。确保设备在执行录制时有足够的资源。

  4. 录制配置:检查uitest的录制配置,确保没有设置不当的过滤条件或限制,这些可能导致某些操作被忽略。

  5. 软件版本:确认uitest和HarmonyOS的版本是否匹配,以及是否存在已知的bug。尝试更新uitest或HarmonyOS到最新版本。

如果问题依旧没法解决请联系官网客服,官网地址是:https://www.itying.com/category-93-b0.html。

回到顶部