iOS UI自动化。执行logElementTree时,并非显示所有元素 [英] iOS UI Automation. Not all elements are displayed when executing logElementTree

查看:101
本文介绍了iOS UI自动化。执行logElementTree时,并非显示所有元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我具有以下UI元素层次结构:

I have the following hierarchy of UI Elements:


-UIATableView

-UIATableView

---- UIATableCell

----UIATableCell

-------- UIAStaticText

--------UIAStaticText

-------- UIAButton

--------UIAButton

UIATableCell 中的第三个元素应该是加载指示器,它会动态显示在屏幕上,但是它不在那儿。我在执行 logElementTree 之前使用 .delay()。我确信代码中的所有内容都是正确的。
还有其他人遇到过这个问题吗?
它有解决方案吗?

The third element in the UIATableCell should be 'loading indicator' which is dynamically appears on the screen, BUT it is not there. I use .delay() before executing logElementTree. I am sure that everything in the code is correct. Anyone else encountered this problem? Does it has a solution?

推荐答案

UIATableCells由于某种原因只会显示StaticTexts和该单元格的Button。当我尝试验证单元格中包含图像时,我的一个应用程序中存在相同的问题。在此问题解决之前,您必须找到其他引用方式。

UIATableCells for some reason will only show StaticTexts and the Button for the cell. I have the same issue in one of my apps when I try to verify that the cell contains an image. Until this gets fixed you'll have to find some other way of referencing it.

在此处查找类似问题

如何在UIATablecell中访问图像

我相信这与自动化创建表单元格的方式有关。 UIATableCell的类引用具有这样的含义:

I believe this has something to do with the way the table cells are created in automation. The class reference for UIATableCell has this to say:


重要:在某些测试方案中,尤其是新的屏幕外
表单元元素,UI自动化无法立即为元素生成
标签,从而使您的
脚本无法访问该元素。为避免自动化测试产生问题,您的
应用程序应始终为新的
表单元格元素设置accessibilityLabel属性。有关
的更多信息,请参见UIAccessibilityElement类参考。

Important: In certain test scenarios, particularly with new off-screen table cell elements, UI Automation is unable to immediately derive a label for an element, rendering that element inaccessible to your script. To avoid resultant problems with automated tests, your application should always set the accessibilityLabel property for new table cell elements. See UIAccessibilityElement Class Reference for more information.

编辑:为清楚起见,我不确定上面的内容概述了这个问题,因为我没有参与到该部分问题中,但是它确实表明,生成TableUI的UIAElements的系统并不是100%。

Just for the sake of clarity I'm not exactly sure that the above blurb outlines this problem as I have not been involved in that part of the problem, but it does show that the system for generating UIAElements is not 100% for TableCells.

这篇关于iOS UI自动化。执行logElementTree时,并非显示所有元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆