正在研究uiautomator2任务,有时发现Android View的文本和内容描述是可变的 .
例如,一次UiObject2将 Your Device
显示为 text
, null
显示为 content-desc
. 但是另一次,相同的UiObject显示 null
为 text
, Your Device
为 content-desc
.
添加图片以供参考:https://drive.google.com/open?id=1h0k7RhKGYBsh0Ot-SxyJ_n8sXeEVDG15(对不起似乎我不允许发布图片)
这种现象令人沮丧,有时候使自动测试变得更加复杂 .
My question is: how can this be done? Does they apply methods like setText() or setContentDescription()? And what is the meaning of this mutablility?
任何意见表示赞赏,谢谢 .